Linux Hosting
NT/2000 Hosting
DYO Internet Access
HTMLez.com
JAVASCRIPTez.com
ASPez.com

Select a Domain
    

Change to Global Variables in PHP 4.1+

Link: PHP Documents SuperGlobals

In PHP 4.1 or later, with the default configuration, the variables submitted to a php script are not created as global variables. Instead, to obtain the values you must use $_GET, $_POST, or $_REQUEST arrays.

  • $_GET contains all variables submitted in the query string
  • $_POST contains all variables submitted by a POST form submission
  • $_REQUEST contains both of the above.
  • $_FILES, contains any files that were sent using the <input type="file" /> tag.

Sample:

<?php
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$comments = $_REQUEST['comments'];

echo (" Name : $name ");
echo ("E-mail : $email ");
echo ("Comments : $comments ");
?>

Or if you have access to it, you can edit your php.ini file:

set 'register_globals' to On.

cover
cover

cover
cover

PHP Copyright Notice