Re: PHP Sessions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry bout that little mistake. You right I mean to check to see if
$_SESSION['loggedin'] == "yes"; That doesn't make a difference as it turns out. The reason that I immediately change this is that I want the content of the page to change, and in order to do that I want to stop it from going into this code? Actually I am not going to do this, I will use another variable, but by setting $_SESSION['loggedin'] to 'no' it should not go into this test, but it somehow does? Is it to do with the link:
<a href=\"index.php?action=edit\">
does this call the script again, just as an action="script.php" in a form would? Cheers for the help on this.


Chris W. Parker wrote:
rory walsh <mailto:rorywalsh@xxxxxx>
    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.

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux