Actually, register globals does something else and is not the solution.
$_GET, $_POST, $_SESSION, $_REQUEST, $_SERVER, $GLOBALS, etc. are called "superglobals" variables and are
always available and populated since PHP v4.1.0 whenever there is a request made to the page in question.
Register globals (which is an old method of php programming and *NOT* recommended) will transform each parameter from a GET or POST http query query string to a PHP variable ... meaning:
If you requested "index.php?user=john&location=atlanta" then inside index.php you will have available 2 variables: $user which value is the string "john" and $location which value is "atlanta".
This method of programming is not recommended for various security reasons as well as bad way of programming (there are hundreds of pages writton on "register globals" in php). You can read what the php developers have to say:
http://php.net/manual/en/security.registerglobals.php. Register globals should be always turned off which in fact is stated in the ini file also just above it. From the php.ini file:
Quote:
; - register_globals = Off [Security, Performance]
; Global variables are no longer registered for input data (POST, GET, cookies,
; environment and other server variables). Instead of using $foo, you must use
; you can use $_REQUEST["foo"] (includes any variable that arrives through the
; request, namely, POST, GET and cookie variables), or use one of the specific
; $_GET["foo"], $_POST["foo"], $_COOKIE["foo"] or $_FILES["foo"], depending
; on where the input originates. Also, you can look at the
; import_request_variables() function.
; Note that register_globals is going to be depracated (i.e., turned off by
; default) in the next version of PHP, because it often leads to security bugs.
; Read
http://php.net/manual/en/security.registerglobals.php for further
; information.
Instead, you should always use the superglobals. So, for the example above, inside index.php, instead of using $user and $location you would always access your data from $_GET['user'] and $_GET['location'].
All paramters passed in the query string when you called the page (like i wrote it above) are available in $_GET. When you write a form with "method=post" then the form's elements' name become indexes of the $_POST array (see
http://us2.php.net/manual/en/language.v ... ternal.php)
This is a very basic part of PHP that you should get a strong grip on before advancing and building interactive web pages. Check out the php manual about this for more details ... the user comments available on each page of the online manual are usually worth reading. You can start here
http://us2.php.net/manual/en/language.v ... efined.php .. further links can be found on that page about each superglobal.
Cheers