Posted by Good Man on 07/18/07 19:24
"dpinion@gmail.com" <dpinion@gmail.com> wrote in
news:1184785906.714977.76830@x35g2000prf.googlegroups.com:
> Greetings,
> I am trying to do some simple session stuff. However it does not seem
> as though the session variable is being created for my site. I am
> running the latest version of PHP and apache that I installed as part
> of WAMP. Machine is XP SP2.
>
> Basically I am trying to do something simple such as:
>
> <?php
>
> // initialize a session
> session_start();
>
> // increment a session counter
> $_SESSION['counter']++;
>
> // print value
> echo "You have viewed this page " . $_SESSION['counter'] . " times";
you don't see your new session/cookie value until you call it from the
NEXT/FOLLOWING page.
Also, this might make more sense:
$_SESSION['counter'] = $_SESSION['counter']++;
Navigation:
[Reply to this message]
|