setting it up so that when people are logged in they will get some extra links that visitors don't.
I had used a simple isset($_SESSION['logged_in'] statement to archive this, but was thinking is there a better solution?
PHP related forum, discuss snippets, classes and tutorials
setting it up so that when people are logged in they will get some extra links that visitors don't.
I had used a simple isset($_SESSION['logged_in'] statement to archive this, but was thinking is there a better solution?
I remember me that I added this session var for this purpose...
Hi Olaf,
I tried like this:
if(!isset($_SESSION['logged_in']))
// user CAN'T vote
else
// user CAN vote
But this is not working. Either the user logged in or not, i am getting the output of if statement(not else) only.
Am i wrong somewhere?
It makes more sense to use it "upside down", why should people not allowed to vote after the are logged in?
do you placed a session_start() at the top of you file?
well, there is a NOT operator before isset..
actually, before u answered i tried by keeping the access_user object in the file and it worked.
I think session_start will work instead of the access_user object. I forgot to use the session_start before.
Thank you !!
you're welcome
This topic has been closed to new replies.