Plz help w/ global variables
| From: | Anthony Rodriguez | Date: | Sun, 07 Jul 2002 11:25:10 +0000 |
| Subject: | Plz help w/ global variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-105955@lists.php.net to get a copy of this message | ||
To test global variables, I wrote the following PHP script:
(1)<?php
(2)session_start();
(3)session_register("counter");
(4)$counter++;
(5)echo "$counter";
(6)// header ("location:statistics/contents.php");
(7)?>
When the script is called several times, the variable is increased accordingly. Thus, it exists globally.
But when I un-comment line (6), the Web page ("contents.php) is displayed but I cannot echo the variable.
Why?
Thanks!
Tony
PS: Richard, thank you for your reply, but I still don't understand why is not passed.