RE: [PHP] PHP Sessions?
| From: | Chris W. Parker | Date: | Wed, 02 Mar 2005 22:22:04 +0000 |
| Subject: | RE: [PHP] PHP Sessions? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-209864@lists.php.net to get a copy of this message | ||
rory walsh <mailto:rorywalsh@ear.ie>
on Wednesday, March 02, 2005 2:08 PM said:
> Thanks everyone, I'm getting closer. The only problem I have not is
> that I keep entering that test, I modified it to change the session
> variable once we enter the test but it somehow does not seem to
> change it? This is the code,
Immediately I see:
> if(strlen($_SESSION['loggedin']=="yes")){
That doesn't make sense. Do you mean?:
if($_SESSION['loggedin'] == "yes") {
And the next line:
> $_SESSION['loggedin']="no";
Why are you reversing the value of 'loggedin'? Once the person is logged
in shouldn't they stay that way until session timeout or they log out?
> When I click the logout button it works fine, but when I click on the
> link inside the page it simply reloads the same page as if the session
> variable has not changed at all? If I link to a page like this does it
> call the script again, or does this need to be done with a form
> submit? I must apologise for my lack of knowledge here! I program in
> other languages and as a result I have that I can get really deep in
> code I don't understand very fast!
Maybe you've already stated this in a previous email and I just don't
remember, what exactly is it that you're trying to accomplish?
Chris.