Entry
How can I pass data between scripts using the URL?
How do I make a GET request in PHP?
Feb 4th, 2006 06:43
Andrew Mather, Ben Munoz, Nathan Wallace, Onno Benschop, http://www.php.net/manual/function.urlencode.php3
You can do this simply using the following syntax:
test.php3?variable1=value1&variable2=value2&variable3=value3
and so on.
Then in test.php3, value1, value2, value3 will be automatically stored
in $variable1, $variable2, $variable3 respectively.
Note: Be careful of what your variables contain. They might have
unsafe characters, so that your linked-to script doesn't behave as
expected. Read about the urlencode function at php.net.
http://www.php.net/manual/function.urlencode.php3
*** NOTE: THIS IS NO LONGER AUTOMATICALLY AVAILABLE as of PHP 4.2 ***
See: http://uk2.php.net/manual/en/language.variables.external.php
KEY SECTION IS THIS: -- Note PHP directive register_globals --
<?php
// Available since PHP 4.1.0
echo $_POST['username'];
echo $_REQUEST['username'];
import_request_variables('p', 'p_');
echo $p_username;
// Available since PHP 3. As of PHP 5.0.0, these long predefined
// variables can be disabled with the register_long_arrays directive.
echo $HTTP_POST_VARS['username'];
// Available if the PHP directive register_globals = on. As of
// PHP 4.2.0 the default value of register_globals = off.
// Using/relying on this method is not preferred.
echo $username;
?>