2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2002-07-01 18:10:17 +00:00
|
|
|
<!-- $Revision: 1.8 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/var.xml, last change in rev 1.34 -->
|
|
|
|
<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>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>import_request_variables</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>types</parameter></methodparam>
|
|
|
|
<methodparam choice="opt"><type>string</type><parameter>prefix</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<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
|
2002-05-17 03:26:28 +00:00
|
|
|
specify which request variables to import. You can use
|
2002-04-15 00:12:54 +00:00
|
|
|
'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
|
2002-05-17 03:26:28 +00:00
|
|
|
includes the POST uploaded file information. Note that the
|
|
|
|
order of the letters matters, as when using "gp", the POST
|
2002-04-15 00:12:54 +00:00
|
|
|
variables will overwrite GET variables with the same
|
2002-05-05 12:20:31 +00:00
|
|
|
name. Any other letters than GPC are discarded.
|
2002-04-15 00:12:54 +00:00
|
|
|
</simpara>
|
2002-05-05 09:19:11 +00:00
|
|
|
<simpara>
|
|
|
|
The <parameter>prefix</parameter> parameter is used as a 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
|
2002-05-05 11:55:37 +00:00
|
|
|
a prefix "pref_", then you'll get a global variable named
|
2002-05-05 09:19:11 +00:00
|
|
|
$pref_userid.
|
|
|
|
</simpara>
|
2002-05-06 01:52:29 +00:00
|
|
|
<simpara>
|
|
|
|
If you're interested in importing other variables
|
|
|
|
into the global scope, such as SERVER, consider using
|
|
|
|
<function>extract</function>.
|
|
|
|
</simpara>
|
2002-04-15 00:12:54 +00:00
|
|
|
<note>
|
|
|
|
<para>
|
2002-05-06 01:52:29 +00:00
|
|
|
Although the <parameter>prefix</parameter> parameter is
|
|
|
|
optional, you will get an
|
|
|
|
<link linkend="internal.e-notice">E_NOTICE</link> level error if
|
|
|
|
you specify no prefix, or specify an empty string as a
|
2002-04-15 00:12:54 +00:00
|
|
|
prefix. This is a possible security hazard. Notice
|
|
|
|
level errors are not displayed using the default
|
2002-05-06 01:52:29 +00:00
|
|
|
<link linkend="ini.error-reporting">error reporting</link>
|
|
|
|
level.
|
2002-04-15 00:12:54 +00:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
<informalexample>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
// This will import GET and POST vars
|
|
|
|
// with an "rvar_" prefix
|
|
|
|
import_request_variables("gP", "rvar_");
|
2002-05-06 01:52:29 +00:00
|
|
|
|
|
|
|
print $rvar_foo;
|
2002-04-15 00:12:54 +00:00
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</informalexample>
|
|
|
|
<simpara>
|
2002-07-01 18:10:17 +00:00
|
|
|
See also <link linkend="reserved.variables.request">$_REQUEST</link>,
|
|
|
|
<link linkend="ini.register-globals">register_globals</link>,
|
|
|
|
<link linkend="language.variables.predefined">Predefined Variables</link>,
|
2002-05-06 01:52:29 +00:00
|
|
|
and <function>extract</function>.
|
2002-04-15 00:12:54 +00:00
|
|
|
</simpara>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|