philip Wed Jun 11 00:38:52 2003 EDT Modified files: /phpdoc/en/reference/session/functions session-register.xml Log: Link to $_SESSION docs, added ¬e.registerglobals; entity, and some example comments. Index: phpdoc/en/reference/session/functions/session-register.xml diff -u phpdoc/en/reference/session/functions/session-register.xml:1.8 phpdoc/en/reference/session/functions/session-register.xml:1.9 --- phpdoc/en/reference/session/functions/session-register.xml:1.8 Fri Jan 31 14:14:58 2003 +++ phpdoc/en/reference/session/functions/session-register.xml Wed Jun 11 00:38:52 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/session.xml, last change in rev 1.2 --> <refentry id="function.session-register"> <refnamediv> @@ -25,16 +25,20 @@ <caution> <para> If you want your script to work regardless of <link - linkend="ini.register-globals"><literal>register_globals</literal></link>, - you need to use the <varname>$_SESSION</varname> array. All - <varname>$_SESSION</varname> entries are automatically + linkend="ini.register-globals">register_globals</link>, + you need to instead use the + <link linkend="reserved.variables.session">$_SESSION</link> array + as <varname>$_SESSION</varname> entries are automatically registered. If your script uses <function>session_register</function>, it will not work in - environments where <link - linkend="ini.register-globals"><literal>register_globals</literal></link> + environments where the PHP directive + <link linkend="ini.register-globals">register_globals</link> is disabled. </para> </caution> + + ¬e.registerglobals; + <caution> <para> This registers a <emphasis>global</emphasis> variable. If you @@ -71,13 +75,17 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php +// Use of session_register() is deprecated $barney = "A big purple dinosaur."; session_register("barney"); +// Use of $_SESSION is preferred, as of PHP 4.1.0 $_SESSION["zim"] = "An invader from another planet."; -# The old way was to use $HTTP_SESSION_VARS +// The old way was to use $HTTP_SESSION_VARS $HTTP_SESSION_VARS["spongebob"] = "He's got square pants."; +?> ]]> </programlisting> </informalexample> @@ -102,8 +110,9 @@ </para> </note> <para> - See also <function>session_is_registered</function> and - <function>session_unregister</function>. + See also <function>session_is_registered</function>, + <function>session_unregister</function>, and + <link linkend="reserved.variables.session">$_SESSION</link>. </para> </refsect1> </refentry>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php