Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

import_request_variables(3) [php man page]

IMPORT_REQUEST_VARIABLES(3)						 1					       IMPORT_REQUEST_VARIABLES(3)

import_request_variables - Import GET/POST/Cookie variables into the global scope

SYNOPSIS
bool import_request_variables (string $types, [string $prefix]) DESCRIPTION
Imports GET/POST/Cookie variables into the global scope. It is useful if you disabled register_globals, but would like to see some vari- ables in the global scope. If you're interested in importing other variables into the global scope, such as $_SERVER, consider using extract(3). Warning This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. PARAMETERS
o $types - Using the $types parameter, you can specify which request variables to import. You can use 'G', 'P' and 'C' characters respec- tively for GET, POST and Cookie. These characters are not case sensitive, so you can also use any combination of 'g', 'p' and 'c'. POST includes the POST uploaded file information. Note Note that the order of the letters matters, as when using " GP", the POST variables will overwrite GET variables with the same name. Any other letters than GPC are discarded. o $prefix - Variable name prefix, prepended before all variable's name imported into the global scope. So if you have a GET value named " userid", and provide a prefix " pref_", then you'll get a global variable named $pref_userid. Note Although the $prefix parameter is optional, you will get an E_NOTICE level error if you specify no prefix, or specify an empty string as a prefix. This is a possible security hazard. Notice level errors are not displayed using the default error reporting level. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 import_request_variables(3) example <?php // This will import GET and POST vars // with an "rvar_" prefix import_request_variables("gp", "rvar_"); echo $rvar_foo; ?> SEE ALSO
$_REQUEST, register_globals, Predefined Variables, extract(3). PHP Documentation Group IMPORT_REQUEST_VARIABLES(3)

Check Out this Related Man Page

STREAM_CONTEXT_GET_DEFAULT(3)						 1					     STREAM_CONTEXT_GET_DEFAULT(3)

stream_context_get_default - Retrieve the default stream context

SYNOPSIS
resource stream_context_get_default ([array $options]) DESCRIPTION
Returns the default stream context which is used whenever file operations (fopen(3), file_get_contents(3), etc...) are called without a context parameter. Options for the default context can optionally be specified with this function using the same syntax as stream_con- text_create(3). PARAMETERS
o $options -$options must be an associative array of associative arrays in the format $arr['wrapper']['option'] = $value. Note As of PHP 5.3.0, the stream_context_set_default(3) function can be used to set the default context. RETURN VALUES
A stream context resource. EXAMPLES
Example #1 Using stream_context_get_default(3) <?php $default_opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en " . "Cookie: foo=bar", 'proxy'=>"tcp://10.54.1.39:8000" ) ); $alternate_opts = array( 'http'=>array( 'method'=>"POST", 'header'=>"Content-type: application/x-www-form-urlencoded " . "Content-length: " . strlen("baz=bomb"), 'content'=>"baz=bomb" ) ); $default = stream_context_get_default($default_opts); $alternate = stream_context_create($alternate_opts); /* Sends a regular GET request to proxy server at 10.54.1.39 * For www.example.com using context options specified in $default_opts */ readfile('http://www.example.com'); /* Sends a POST request directly to www.example.com * Using context options specified in $alternate_opts */ readfile('http://www.example.com', false, $alternate); ?> SEE ALSO
stream_context_create(3), Listing of supported wrappers with context options ("Supported Protocols and Wrappers").. PHP Documentation Group STREAM_CONTEXT_GET_DEFAULT(3)
Man Page