PHP import_request_variables() Function
The importrequestvariables() function imports GET/POST/Cookie variables into the global scope. This function is no longer supported in the latest versions of PHP.
The importrequestvariables() function imports GET/POST/Cookie variables into the global scope. This is useful if you disable register_globals but still need some global variables.
Version Requirements: PHP 4 >= 4.1.0, PHP 5 < 5.4.0
Syntax
bool import_request_variables ( string $types [, string $prefix ] )
Parameter Description:
$types: Specifies the variables to import. You can use the letters G, P, and C to represent GET, POST, and Cookie respectively. These letters are case-insensitive, so you can use any combination of g, p, and c. POST includes file information uploaded via the POST method. Note the order of these letters; when using gp, POST variables will override GET variables with the same name. Any letters other than GPC will be ignored.
$prefix: A prefix for variable names, placed before all variables imported into the global scope. So if you have a GET variable named userid and provide pref_ as the prefix, you will get a global variable named $pref_userid. Although the prefix parameter is optional, if you do not specify a prefix or provide an empty string, you will get an E_NOTICE level error.
Return Value
None.
Example
<?php
// This will import GET and POST variables
// Using tutorialpro_ as the prefix
import_request_variables("gP", "tutorialpro_");
echo $tutorialpro_foo;
?>