Re: Need help with sessions
| From: | Nasko Vassilev | Date: | Wed, 09 Apr 2003 07:47:35 +0000 |
| Subject: | Re: Need help with sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143022@lists.php.net to get a copy of this message | ||
I don't know if you have session_start() at the beginning of your script...
at least it is not implied from the way you've written your message. If not,
just add it.
If you use the $_SESSION global array like Mr. Khalid suggests you do not
have to add session_start()
"Odcs" <odcs@rogers.com> wrote in message
news:003901c2fe22$38cc9530$6401a8c0@p1...
> I must be missing something here as I can not get this to work. I have a
> simple login script - if the login is successfull the user is forwarded to
> another page, if not he is returned to the login page.
>
> index.php has the form in it - when the user clicks submit it is sent to
> check.php for validation. In check php I have the following.
>
> if (!session_is_registered("logged")) { // This is the very first thing
in
> check.php
> session_register("logged");
> }
> .... more validation code.....
>
> if the validation is successful - $logged["logged_in"] is set to "True";
>
>
> Now here is the problem - what do I put in main.php and other pages to
> verify that the user is actually logged in. I have tried many variations
of
> conditional statements, but no matter what I put here I can't get it to
> recognize that $logged["logged_in"] is equal to "True".
>
> I hope I have explained this properly. Any help is appreciated.
>
>