philip Sun Jul 6 12:40:28 2003 EDT Modified files: /phpdoc/en/language variables.xml Log: Remove reliance on register_globals in the cookie example. Index: phpdoc/en/language/variables.xml diff -u phpdoc/en/language/variables.xml:1.66 phpdoc/en/language/variables.xml:1.67 --- phpdoc/en/language/variables.xml:1.66 Sat Jun 28 16:31:17 2003 +++ phpdoc/en/language/variables.xml Sun Jul 6 12:40:27 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.66 $ --> +<!-- $Revision: 1.67 $ --> <chapter id="language.variables"> <title>Variables</title> @@ -972,7 +972,11 @@ <programlisting role="php"> <![CDATA[ <?php -$count++; +if (isset($_COOKIE['count'])) { + $count = $_COOKIE['count'] + 1; +} else { + $count = 1; +} setcookie("count", $count, time()+3600); setcookie("Cart[$count]", $item, time()+3600); ?>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php