Q really newbie question

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
mattshiao
Forum Newbie
Posts: 2
Joined: Sat Apr 11, 2009 5:59 am

Q really newbie question

Post 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
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Q really newbie question

Post by kaszu »

Post Reply