Re: Session Trouble
| From: | Stephen | Date: | Thu, 24 Oct 2002 23:50:38 +0000 |
| Subject: | Re: Session Trouble | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121371@lists.php.net to get a copy of this message | ||
That'd work nice for me too but I'm including a small table into the main
page toward the center. Forwarding them to the included page wouldn't work
in this case...
----- Original Message -----
From: "Peter Houchin" <php@vfsa.com.au>
To: "Stephen" <webmaster@melchior.us>; "PHP List"
<php-general@lists.php.net>
Sent: Thursday, October 24, 2002 6:34 PM
Subject: RE: [PHP] Session Trouble
> > I'm trying to register a session for a poll by first opening the
> > session (session_start()), then registering it like this:
> >
> > $_SESSION['voted'] = "yes";
> >
> > Problem is, when I check to see if the session is there:
> >
> > if(isset($_SESSION['voted']))
> >
> > I have it load up a page containing the poll results:
> >
> > <?php if(isset($_SESSION['voted'])) {
> > include("poll_voted.php"); } ?>
> >
> > But it doesn't display it. It displays the default (which is the
> > voting part). Any ideas why?
>
> Stephen
>
> i have this sort of thing in my site .. what I suggest (and this works for
> me no problems) is
>
> <?php
> if (isset($_SESSION['voted'])){
> Header ("Location:poll_voted.php");
> }
> ?>
> I prefer to do it that way than to use includes, also you will have to
make
> sure this is at the very top of the page before any html tags etc are set.
>
> Cheers
> Peter
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>