mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Adding documentation for import_request_variables with example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@61971 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
35c7a1844d
commit
9daae4409f
1 changed files with 58 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.74 $ -->
|
||||
<!-- $Revision: 1.75 $ -->
|
||||
<reference id="ref.var">
|
||||
<title>Variable Functions</title>
|
||||
<titleabbrev>Variables</titleabbrev>
|
||||
|
@ -293,6 +293,63 @@ echo get_resource_type($doc->doc)."\n";
|
|||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.import-request-variables">
|
||||
<refnamediv>
|
||||
<refname>import_request_variables</refname>
|
||||
<refpurpose>Import GET/POST/Cookie variables into the global scope</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>import_request_variables</function></funcdef>
|
||||
<paramdef>string <parameter>types</parameter></paramdef>
|
||||
<paramdef>string
|
||||
<parameter><optional>prefix</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<simpara>
|
||||
Imports GET/POST/Cookie variables into the global scope. It is
|
||||
useful if you disabled
|
||||
<link linkend="ini.register-globals">register_globals</link>,
|
||||
but would like to see some variables in the global scope.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Using the <parameter>types</parameter> parameter, you can
|
||||
specify, which request variables to import. You can use
|
||||
'G', 'P' and 'C' characters respectively 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 uploaded file informations. Note, that the
|
||||
order of the letters matters, as using "gp", the POST
|
||||
variables will overwrite GET variables with the same
|
||||
name. Any other other letters then GPC are discarded.
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
Although the <parameter>prefix</parameter> argument is
|
||||
optional, you will get a 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.
|
||||
</para>
|
||||
</note>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
// This will import GET and POST vars
|
||||
// with an "rvar_" prefix
|
||||
import_request_variables("gP", "rvar_");
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
<simpara>
|
||||
See also <link linkend="ini.register-globals">register_globals</link>
|
||||
and <link linkend="ini.track-vars">track_vars</link>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.intval">
|
||||
<refnamediv>
|
||||
<refname>intval</refname>
|
||||
|
|
Loading…
Reference in a new issue