Session Start: Tue Sep 19 11:38:02 2000 *** Now talking in #netsurprise *** Topic is 'WEBMASTERS ONLY!!! Welcome to the Net Surprise Adult Webmaster IRC Chatroom.' *** Set by SurpriseBot on Tue Sep 19 00:58:24 -SurpriseBot- Welcome - Net Surprise IRC - thud.net channel #netsurprise cool Cool Electra :> Hey TDavid hi zoink! *** Wolfe has quit IRC (Connection reset by peer) How are you doing? Hi TD hello electra u going to the show? what show new orleans :) Oh..the Convention...no..you? *** TimeWalker sets mode: +o TDavid we can't make this one ... but we'll be at vegas in January thanks tw *** Chazz has joined #netsurprise 04¤WB 14(Chazz14) 04WB¤ 14- Nice to see u back boss man! *** TimeWalker changes topic to 'WEBMASTERS ONLY!!! Welcome TO the TDAVID SHOW ' *** Retrieving #netsurprise info... *** Sassy has joined #netsurprise hi :) hi sassy I have no time to do anything but work even if I could get time off from my offline job...I am going to be swamped hey ZoiNk *** Retrieving #netsurprise info... How are you i am here for a little wile intill i have to go to work hehehehehe yikes ... how about "PHP Course #3: All about arrays" Instead, tw hehe Well I have to get back to my job....have piles of stuff to do before 4...have a good chat. lol that might work better lol bye bye Electra *** Electra has quit IRC (QUIT: User exited) bound to scare them away hehe *** TimeWalker changes topic to 'WEBMASTERS ONLY!!! Welcome the Tdavid Show covering PHP Course #3: All about arrays' ya i dunno thats a good thing or not lol hehe soooo long hehehehehe ok quizz lol ?#1 yes today there will be a pop quiz hehe what is an array ruh ro hehehehehe *** Compdoctor has joined #netsurprise *** TimeWalker changes topic to 'WEBMASTERS ONLY!!! Welcome It's School time Todays lesson is PHP Course #3: All about arrays' hi Compdoctor ? # 2 can it hold strings hey lol @ TimeWalker how r u hon? Hi comp the person who scores the highest walks away with a free script :) hey floppy speakin of scripts i need to talk to u bout 1 sometime TDavid ;) YaHooooooo !!!!!!! lets start the Quizz * Sassy thinks Chazz is a freak some1 told him test a web site to see if its resolved so whats he do? types in "hi world LOL :) " w/o the "" lol kewl sassy :) lol hey TDavid quick question... u goin to cyber net expo? nopers, going to vegas in January :( that stinks maybe we'll go to both lol we pretty much only go to shows in vegas ... but we may go to sharkysr's deal in chicago we love vegas :)) ya thats where cyber net expo is in november thats y i asked ;) when is school td? now? in 10 minutes by my watch anyway this is not live right nope, not live, it's memorex :) my cable died :((((((((((((((( Sorry was ordering supplies Where you staying in Vegas TD ok i gotta run and make lunch for Chazz b4 he goes to work TD i'll keep an eye on your room so that u dont have to be in 2 places at once we usually stay at MGM or fitzgeralds, but we don't have those plans yet that will be my tuesday job :) we just have our airline tickets hehe ok I'l be at the Circus i like the circus circus :) me too the kids do too I like the vip treatment did I miss school again nope, it starts in 6 minutes :) ok cool is it live? live here, yes, on the radio ... no :) Sassy private please oh ok I just busted a major kid porn site today good for u Compdoctor yea buttholes came to my site leaving the backdoor url go figgure lmfao doh! 144 galleries with 50 images per gallery i busted a cp pay site sunday and brage about it sheeit!!! sickos go girl this one had sexual also :) dogs this one 1 showin a lil girl givin head and other stuff worse than that sick shit yea that stuff too :( wish I could talk to them personal * Sassy gets soooo pissed off at that shit ya me too i dont think i would be talkin though Sassy private me please there are SOOO many legitimate ways to make money on the net, it amazes me why people would ever go down that horrific road :(( ya well they are just mentally fucked they need institutionalized no they need to meet a few good men in a dark alley lol can i volunteer to be 1 of them even though i m a woman lol ok raise your hand if you're in the class ... we're about to go moderated here and those not voiced will not be able to ask questions * Sassy raises her hand * Compdoctor rasies hand * TimeWalker ponders rasies hand chazz attempts to raise his hand there chazz :) i think floppy tooo * ZoiNk sips his tea? *** Compdoctor is now known as CompDoc-Recording wrong answer ZoiNk sorry *** TimeWalker sets mode: +vvv Chazz CompDoc-Recording floppy *** TimeWalker sets mode: +v Sassy *** Retrieving #netsurprise info... *** TDavid sets mode: +m can somebody leave and come back really quick, testing somethign here hehe yer watch is 4 mins early but who cares *** Sassy has left #netsurprise *** Sassy has joined #netsurprise Welcome Sassy to the tech chat .. this is a moderated instructional chat so please private timewalker to get voice so you can ask questions and take the PHP quiz! *** TDavid sets mode: +v Sassy thank you :) thx hon np got your message :) *** CompDoc-Recording has quit IRC (Connection reset by peer) im using the official doKK clock hehe we'll wait for compdoc to return... poor guy keeps gettin that 2day ok i m gonna go make lunch bbiab just before we start how far back can php read header info? i don't think i really understand the question how far back? ok it can read stuff like browser, etc and with java you can read current session history can php? in php4 you can do sessions yes never mind I'll ask later when it's not school time hehe it is still a state language, not a stateLESS language however because it is server side so you still need to employ some technique in addition to the php to maintain state got my comment above backwards hehe it's K :) php is a stateLESS language ... you need to employ other means to make it state flash is state, java is state, javascript is state shockwave is state i'm actually glad you asked that question because it is important to understand that early on that is the flaw with any cgi scripting language perl/php/asp is all stateless php4 has come some way in making things better with session support but still if you want to track people all around the site and maintain state you need to use cookies or some other type of means hidden forms work, but any time the surfer can view the source of the hidden input forms or query string your program is vulnerable to some degree like I had to resort to java for screen resolution JS yup i want to talk about precedence for a minute ... there is precedence in mathematics and in programming i posted a response to willyB the other day with the order of precedence *** Bestat has joined #netsurprise 12,0 Welcome Bestat to the tech chat .. this is a moderated instructional chat so please private TimeWalker to get voice so you can ask questions and take the PHP quiz! HIGHEST precedence: (){ } ~ ! ++ - - $ & * / % + - < > <= >= == != LOWEST precedence (paused to avoid flood) i used this example for him $total = 4 + 2 / 2; // result is 5 if you look you'll see that division takes "precedence" over addition *** Bestat has quit IRC (QUIT: User exited) well what if we wanted 4+2 = 6 / 2 ? notice the use of parenthesis in the hierarchy? parenthesis have the HIGHEST precedence we'd use something like this: (4+2) yeah (4+2)/2 = 3 *** Wolfes-woman has joined #netsurprise 12,0 Welcome Wolfes-woman to the tech chat .. this is a moderated instructional chat so please private TimeWalker to get voice so you can ask questions and take the PHP quiz! why this may seem of little consequence now, it does make a difference when you start performing mathematical computations in your scripts math on $holders *** breeze has joined #netsurprise could you explain modular operators *** Wolfe has joined #netsurprise well lots of math is done on things like say coming up with ratios for clickthrus and things global ratios, etc IE:$i % $j 2 opps do we have to pm tw to ask a ? no *** TimeWalker sets mode: +v Wolfe bitwise operators are very useful in C but rarely used in PHP, is that what you are talking about floppy? I was starting to feel left out in that example $i=12 and $j=5 *** breeze has quit IRC (QUIT: User exited) well modulars return the remainder of a division ?? with the % now you're getting too mathematical on me, floppy lol *** sharkysr has joined #netsurprise hehe i see your point, there may be times you need to use the remainder *** JP_HardcoreBox has joined #netsurprise * TimeWalker thinks td has a glitch in his script here are the various operators and their functionality 1. . = concatenate *** TimeWalker sets mode: +v sharkysr 2. $ = reference a variable 3. & reference variable storage 4. -> reference a class method or property (OOP) floppy thinks the live show aut to be like this this is real helpfull 5. => Set argument default or assign array element index 6. @ suppress function errors 7. Tertiary Conditional Expression knowing what these are at this point is really all you need to know, knowing when to use these things we will deal with as they come up some of these you might not even need to use or want to could you explain the tertiary conditional expression not familuar with that term tw, i changed the onjoin message to be in private so it wouldn't be in the logs :) What is the & used for TD, is it in MySql? not it is used to pass information into a function, sharkysr er no, that was ok basically you can pass a condition to a function ahh K td tertiary conditional expression is really just a shortcut, floppy *** msbrownie has quit IRC (QUIT: User exited) could you exp[lain nesting variables with the double $$ the logs for these classes are accessable by clicking from scriptschool.com if anyone should miss these is that used to store a variable with in a variable ? here is a use for the ternary operator if($mynumber > 1) { $myname = 'TDavid'; } else { $myname='TimeWalker'; } that same expression can be shortened using the ternary operator $myname='TimeWalker' . ($mynumber > 1 ? "myname" : "myname"); ah got ya stick with if/else it's a lot simpler hehe can we ask any ? about php unless you have a need to shorten up your code considerably you use tricks like that *** ZoiNk has quit IRC (QUIT: User exited) $myname='TimeWalker' . ($mynumber > 1 ? "mynumber" : "mynumber"); // this is correct line when are we going to get into enviromental variables such as Doucment_root ect Course #8 covers header and environmental variables ah ok :) yes you can ask questions, but if you stay with what we covered so far it will be more beneficial i think * TimeWalker thinks we should have a course a day did i miss a question from anybody? When are we going to cover exploding a variable, if you don't mind me asking we can cover that right now, since I showed you with the date() thing how to avoid multiple function calls did you see that code? $string = date("l,|jS|F, Y.");$date_array = explode("|", $string);print("$date_array[0] the $date_array[1] day of $date_array[2]"); Yea, I saw it there, just hadn't had the time to study exactly how it works yet So you can use anything there, or just the pipe? basically we are putting a delimiter inside a string to separate the contents, then we are exploding the contents of that string by using that same delimiter you can use anything, but i would stay away from common things like commas, periods, dashes, etc can you explain a concat operator So if we just use the pipe, we will be safe. even exploding by newlines can be tricky no, not necessarily, some sponsors have scripts where they are using pipes in the sponsor codes the pipe is SUPPOSED to be a delimiter we can use without having that happen, but some programmers are sloppy Would you use the same technique when writing to a file, using the| to delimit records/fields, so you can explode them when you read it back? a concatenation operator, explain it how, floppy? it concatenates lol adds two strings together ok yes, sharkysr, i would use pipes in most cases, there are exceptions but then again there are exceptions to all of programming to avoid confusion i try to show you guys the norm and not the abnorm and gals too, btw :) good idea TD...hahaha now as for the arrays, does everyone understand what they are and what they do? it seems from the code posted that most of you do :) Did you ever get to critique the advanced lessons TD? arrays are just big storage tanks ... variables are like small singular ones like maybe a gas pump or something TD ? how far would you go or how many tables would you make for msql before it gets complicates nope i haven't stopped by the advanced lessons yet msql or MYsql? hehe i don't do much msql, to be honest, mysql is better :) Mysql well floppy that is somewhat of an open-ended question that i'd ask you to reask me in week 14 after we've covered mySQL a bit. That is similar to the question the guy asked at the tech board how many hits can i do a day with a ... {insert hardware here} so many variables involved there really is no simple answer * floppy just wondering cannot help playing with diffrent aspects of it quirosity gets me ya know ;) i've seen 100 table mysql setups that were confusing and 10,000 table ones that weren't Good answer TD, probably depends on how they are layed out. let's say you have 1000 members and each member has 3 tables of their own that are essentially identical ... now you have 3000 tables but really they all are the same basic type of information rather than one huge gargantuan table with everybody's info lumped into it as you can probably guess with mySQL or any database the smaller the pool of information you work with, the better off you usually are be easire to add tables that way or values ect but working with 10,000 small tables is much less efficient than working with 100 larger ones and retriev info What you would have is a single table with member name and number in it that would tie to individual tables for each member so again, it is a tricky question and not easily answered ok ;) thanks TD well yes, the ideal database never repeats information and is interconnected relationally I love those big words... IE. http:// <--- we all know that starts with a url so why even store in a file or database at all use the script to append that to the information you can't do http://www. though because some sites are just ips but you'd be suprised how many databases store 'http://' in it ... over and over and over again *** Conepuppy has joined #netsurprise Hmm Hi cone 10,000 'http://' add up when you really only need to append on the fly pup!! :) plus anything you append from the script will be quicker than retrieving using I/O *** TimeWalker sets mode: +v Conepuppy why is that? disk access is what slows everything down is their a max on number of characters for a table like say name (first_name varchar(20) or can it be (50) if we had no disk access to worry about, imagine how fast things would be If you have to retrieve a record anyway, is the size going to make a difference? yes, there are limits hey TD! absolutely, sharkysr let me give you an example i was recently working on a database of 10,000 records ... the password field was set to 75 characters you ever seen a 75 digit password? or the need for one? no point made ;)) so basically there was 65 characters x 10,000 records ouch I can see your point in that case, but when you are talking about an additional 7 bytes on a record, will you see the difference? got ya ;) guys like pup will see the CPU flutter if a lot of hits happen on a setup like that hehe haha it isn't the 7 bytes, sharkysr ... you got to remember that web is based on traffic ... you start multiplying 7 bytes by 100k hits a day now it starts adding up That is true. Something I need to keep reminding myself about. you can always make things bigger, but it is more difficult to make things smaller there is a great function known as "ALTER" you can alter any character field to be bigger but if you alter it to be smaller you start truncating fields and can run into trouble sometimes That is within the MySQL, right? let's say you had a field with a built in delimiter 'size-name' <-- now if you change the field to 4 digits you just ruined the delimiter and your script would not function right the delimiter being the dash in this case arent you better off to use varing character for larger fields and char for know foelds such a age or sex m/f *** Conepuppy is now known as coneOnphone * floppy well thats all the ? I have hehe head spinning now lol char() uses less memory than VARCHAR() because it is a fixed field no matter what. So if you know the size of the field like say a password field use that. It may also be a little faster in the way the index moves around right thank you alright, who's ready for the quiz hehe noit yet head spinning lol lol, floppy is it multiple choice?? lol thats good ok fire away question 1. a variable can contain multiple items separated by commas? True or Fals fales question 1. a variable can contain multiple items separated by commas? True or False false :) false a variable only contains one item floppy? an array can contain multiples phone brb move on ill catch up nice way to avoid the Q floppy....haha nod sharky well you miss i count that as wrong :) you got a 50/50 chance here hehe quiz delay explain they are all true fals btw :) damn whats up with the 'e' incidentally hehe and they are trick questions too :) floppy ... going once ok back #! false wolfe you got a guess? #2? $variable = 'item1,item2,item3,item4'; the answer is TRUE, a variable CAN contain multiple items separated by a comma for what purpose? *** coneOnphone has quit IRC (QUIT: User exited) ok let move on * TimeWalker screams you can explode the contents into an array what was the question ??? one sec phone again brb he's right that cause you can read a comma delimited file into one variable split or explode it into an array I shoulda fucking known that since I'm doing it You are only suppose to ask questions about things you've already taught us TD i have taught you that :) it's on the boards as an example, yes? hehe Or wasn't I paying attention the date thing, plus we reviewed it today :) ok damm it was multiple items separated by a pipe :) ok, next question ... * TimeWalker slaps timewalker around WAKE UP yea, ok, you are right... Question 2. Arrays can hold strings variables and arrays. TRUE or FALSE true true true multi-dimensional array how many ? are their 10 you are all correct :) batting 500 not bad :) :) We'll be batting 667 in a minute lol td's advanced programming question :) Question 3. print and echo can both accept formatted strings? TRUE or FALSE true true no I think only print false *** LaughingEyes has joined #netsurprise actually the answer is TRUE. A string that is ALREADY formatted can be output using print() or echo() that was a wording trick.. no fair ok next :) have to go pick up kids soon Sounds like a trick question to me lol@TW echo can't accept formatting.. print can sounds like td has done this quizz before *** LaughingEyes has quit IRC (QUIT: User exited) We knew what we were talking about didn't we TW? $string = sprintf("%2.f", $string); echo($string); // try it :) yea SS he did a word play But you are echoing a variable not the formatting itself hehe, can a variable contain a string? that is not question 4, btw Of course * TimeWalker doesn't think that was a fair question Sounds like a protest brewing.....hahaha hehe ok #4 ok ;) OK TW, we are batting 333, we better step up to the plate here. no you answered true But I changed it I answered correctly as false if he haded use trickery in his words lol Question 4. By using date() you can add and subtract time. TRUE or FALSE. haded=hadn't false true You are thinking too hard TW date or date ALONE td * floppy thinks tw thinks this is a nother trick ?;) it is hehe, no hints lol we are subtracting time now TW hehe using date ALONE you can't not add and subtract.. FALSE i hope he is right But he didn't say alone. that all that up their hehe is date lol OK TD, we need the answer.... well true or false ? ;) well he didn't say date inside a function or inside a loop or or or suspoense either $day = date("h:i A l F dS, Y", $timestamp - 86400); // equals 24 hours ago TRUE Hmmmmmmm * TimeWalker goes away floppy what did you say? false tw, you are still batting 250 that's not bad :) so you and sharky are both 2/2 ? and tw 1/3 or sharky 3/4 and you 2/4? moving on and you are only 1 question away from a 400 hehe Question 5. Arrays do NOT have to start numbering at zero. TRUE or FALSE? false false There is an exception to that rule, but I don't remember what it is... yes they is sharky I'm going to say true actually you can start arrays numbering at any index, it is TRUE but typically they start numbering at zero :) right, that is the exception, not the rule.. right so both true and false is correct ? no, you can't have it both ways floppy.....lol no, the answer was true * floppy quits :)) not fair lol;) Question 6. You can use arrays to do conditionals TRUE or FALSE? true yes true tw? this isn't a trick question, really it isn't * floppy well gan I have to go pick up the kids at school thanks TD good luck guys hrmph true correct, it is true cya floppy yea, the crowd goes wild **^^**^^ * floppy great chat today later floppy *** floppy is now known as floppy-away Question 7. A number enclosed in single quotes is not a number. TRUE or FALSE? Now is our chance to pull ahead of floppy on the test....heh false true it may be a literal number, but it is still a number it is a STRING when it is enclosed in quotes, the answer is TRUE it took me a second to think on that one I'm still having a problem with it.. $number = '7'; $number2 = 8; $number + $number2; // answer is 9 because $number is TRUE and thus equal to 1 not equal to 7, as assigned cause the single [1] extent the string by the placeholder if you said $number = ''; number is now FALSE and equal to zero $rick[1] $rick[2] is still a variable not a # so if you want number to really equal the number zero, you need to say, $number=0; but you can explore $rick to get $rick[1] etc explode using a delimiting character $rick[1]and $rick[2] are elements in an array and have nothing to do with numbers Question 8. We could make a picture of the day script without using the date() function? TRUE or FALSE? I understand the concept with the string thing true sharky 4/7 ... tw 3/7 floppy 3/7 but I don't know how... true gmtime yes, you could, the answer is TRUE :) isn't gmtime a part of the date() function? no, that is a separate function Or am I confused about that? OK :) you could also get a unix timestamp, mktime() there is french and gmdate too Question 9. The default time is your local time. TRUE or FALSE? false false it's gmt It is your host/server time correct, it is false even windows uses gmt last question ... we'll need a tiebreaker if you dont' get this right and tw does, sharkysr :) clarify the last question for us, please?? the default time used is the SERVER time unless it is configured differently so it is more false than true ... but COULD be true so sort of a trick question but even theserver time is based on gmt yes every server I've ever been on has displayed their local time yes but the server is translating gmt they may be based on GMT, but they use an offset correct But that wasn't the question anyway via a minus or + on gmt so it's gmt if you get right down to it You'll have to rephrase that question next time you ask it TD.. well you got it right :) Yea, I know, but it could be confusing. idea of these questions is they are supposed to make you think :) they are doing that, without a doubt....lol not necessarily be cut and dried answers hehe :)) OK, one more time TD unless ya miss it SS it is a possibility... also possiable we both miss it and you win by default Question 10. Tuesday is 3 when using the "w" date code. TRUE or FALSE? *** JakeJeck has joined #netsurprise true wrong it is 2 tw? true *** TimeWalker sets mode: +v JakeJeck ty it is true ... congrats sharkysr! you scored 6/10 in the quiz! we are going unmoderated now *** Retrieving #netsurprise info... *** TDavid sets mode: -m how you doing jakejeck? *** TimeWalker sets mode: -vvv Chazz floppy-away JakeJeck *** TimeWalker sets mode: -vvv Sassy sharkysr Wolfe pretty good, thx drop me an email, sharkysr, i have a free script for you :) wait a minute sunday=0 Mon=1 tue=2 yes, it is false i meant you said it is false, yes? OK, I can do that. OH, OK, had me confused for a minute..thanks *** john has joined #netsurprise *** ZoiNk has joined #netsurprise tw said it was true, he was wrong, it was false hehe he got 5/10 you got 6/10 :) we both got it wrong so he still wins dang, i missed the quiz? :( this chat aint moderated :P yup, sorry mon that message was just moderated mon :) er just changed lol ok the class is over "officially" hehe :) Session Close: Tue Sep 19 13:49:16 2000