Page 1 of 1

Q really newbie question

Posted: Sat Apr 11, 2009 6:03 am
by mattshiao
Hi,

I am learning PHP now by watching CDs and having problems with the code snippets in the CD. Say I want to get values from query string like:

page1.php?userid=1

The CD said $userid variable is automatically set so I can use it directly in this manner:

echo "User id is ". $userid

But I have to do it the following way to get it to work:

echo "User id is ". $_GET["userid"]

Same things happen to Form, Session and Cookie. What's up with that?

TIA

Re: Q really newbie question

Posted: Sat Apr 11, 2009 6:13 am
by kaszu