philip Tue Jul 2 20:19:20 2002 EDT
Modified files:
/phpdoc/en/chapters config.xml
Log:
Added an example on what register_globals means.
Defaults to off as of PHP 4.2.0 (links to release announcement)
Added a few links, like to predefined vars and superglobals
Cannot set at runtime, but may be able to use .htaccess
<note>: variables_order affects register_globals
Index: phpdoc/en/chapters/config.xml
diff -u phpdoc/en/chapters/config.xml:1.57 phpdoc/en/chapters/config.xml:1.58
--- phpdoc/en/chapters/config.xml:1.57 Mon Jun 10 17:41:15 2002
+++ phpdoc/en/chapters/config.xml Tue Jul 2 20:19:19 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.57 $ -->
+<!-- $Revision: 1.58 $ -->
<chapter id="configuration">
<title>Configuration</title>
@@ -710,23 +710,37 @@
<listitem>
<para>
Tells whether or not to register the EGPCS (Environment, GET,
- POST, Cookie, Server) variables as global variables. You may
- want to turn this off if you don't want to clutter your
- scripts' global scope with user data. This makes the most
- sense when coupled with <link
- linkend="ini.track-vars">track_vars</link> - in which case
- you can access all of the EGPCS variables through the
- <varname>$_ENV</varname>,
- <varname>$_GET</varname>,
- <varname>$_POST</varname>,
- <varname>$_COOKIE</varname>, and
- <varname>$_SERVER</varname>
- arrays in the global scope.
- </para>
- <para>
- Please note that you need to set AllowOveride All in your
- Directory block in the apache config file for this to work.
+ POST, Cookie, Server) variables as global variables. For example;
+ if register_globals = on, the url
+ <literal>http://www.example.com/test.php?id=3</literal> will produce
+ <varname>$id</varname>. Or, <varname>$DOCUMENT_ROOT</varname> from
+ <varname>$_SERVER['DOCUMENT_ROOT']</varname>. You may want to turn
+ this off if you don't want to clutter your scripts' global scope with
+ user data. As of PHP <ulink url="&url.php.release4.2.0;">4.2.0</ulink>,
+ this directive defaults to <emphasis>off</emphasis>. It's preferred to
+ go through PHP <link linkend="reserved.variables">Predefined Variables
+ </link> instead, such as the
+ <link linkend="language.variables.superglobals">superglobals</link>:
+ <varname>$_ENV</varname>, <varname>$_GET</varname>,
+ <varname>$_POST</varname>, <varname>$_COOKIE</varname>, and
+ <varname>$_SERVER</varname>. Please read the security chapter on
+ <link linkend="security.registerglobals">Using register_globals</link>
+ for related information.
+ </para>
+ <para>
+ Please note that <systemitem role="directive">register_globals</systemitem>
+ cannot be set at runtime (<function>ini_set</function>). Although, you can
+ use <filename>.htaccess</filename> if your host allows it as described
+ above. An example <filename>.htaccess</filename> entry:
+ <userinput>php_flag register_globals on</userinput>.
</para>
+ <note>
+ <para>
+ <systemitem role="directive">register_globals</systemitem> is affected
+ by the <link linkend="ini.variables-order">variables_order</link>
+ directive.
+ </para>
+ </note>
</listitem>
</varlistentry>
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php