$_GET, $_POST, $_REQUEST - Problems with Globals on/off??
Hi,
I currently have a webspace on my College's website and want to use PHP to do some stuff, like passing variables from page to page. For this, I use all the common stuff like $_GET and $_POST. However, on the school server, $_GET and $_POST don't seem to work. Could this be because they have different settings for the Register Globals or something? Am i supposed to pass these variables in some other, more secure way? The server is running PHP 4.2.2, by the way. Thanks!
The super-globals ($_GET, $_POST, etc.) were introduced in PHP 4.1.0, and so should be available. register_globals being on or off should have no effect on those arrays (which is why they should be used instead of depending on register_globals). So based on the information at hand, I do not know why you're having a problem.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Most of the $_SERVER variables are largely dependent upon the web server to set them, so generally speaking none are absolutely guaranteed to be set in any given installation. To see which ones are being set on your server, you could do:
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks