mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Link to $_SESSION docs, added ¬e.registerglobals; entity, and some example comments.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@130999 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
6a8e299009
commit
feef8ae0ce
1 changed files with 18 additions and 9 deletions
|
@ -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 @@ $HTTP_SESSION_VARS["spongebob"] = "He's got square pants.";
|
|||
</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>
|
||||
|
|
Loading…
Reference in a new issue