understanding global variables $GET $POST ect

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

ChrisSkidmore
New php-forum User
New php-forum User
Posts: 19
Joined: Sun Aug 18, 2002 4:02 am
Location: Germany

understanding global variables $GET $POST ect

Postby ChrisSkidmore » Sun Aug 18, 2002 4:12 am

Hi
I'd like confirmation that I understand something please.

If I set Global variables to "OFF" I should still be able to use "$POST, $GET ect to retrieve values from a form.

Does this mean that the receiving page will only take note of the values actually posted (or getted!!) from the form therefore no one can try and call the page by entering values directly into the URL.

Please tell me that's right!!!!

Chris

Jay

Postby Jay » Sun Aug 18, 2002 4:22 am

Nearly, if you set the Register Globals to OFF, you can use $_POST and $_GET

DoppyNL

Postby DoppyNL » Sun Aug 18, 2002 4:29 am

If you set global variables to OFF, the variables sent to the next page by the browser will cannot be accesed like this as a normal variable. They must be accesed via $_POST, $_GET, $_COOKIE or $_SESSION. variables are only set in there "own" array and not in another.
allthough it should be possible for a user to "post" a variable of his own while you didn't in the form.
$_REQUEST is a global array wich contains all the above

see also this manual page, wich should explain it as well:
http://www.php.net/manual/en/reserved.variables.php

Greetz Daan

ChrisSkidmore
New php-forum User
New php-forum User
Posts: 19
Joined: Sun Aug 18, 2002 4:02 am
Location: Germany

Postby ChrisSkidmore » Sun Aug 18, 2002 4:46 am

Hi
Many thanks guys for a very quick answer.

Shortly after getting interested in computing I moved to Germany which stopped me getting in to the "technical" (for want of a better word) way of talking about programming & computing. (I've having a hard enough time learning German!!!)

Although I do try, I find php.net heavy going to read and understand.

Hopefully you won't mind me asking a few basics again.

And if anyone can recommend a "plain English" php reference I'd be interested.

Chris


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest