Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
$_session variable?
Hey,
I`m building a website ..
Ånd I have to show combobox.. when user is admin, it has to show different options..
So I check that with - if(!$_SESSION['isAdmin']): - then it shows options that are for normal user
And I have row in my table called "isAdmin" and by default it is NULL.. For admins I suppous I just write what I want, and it should anyway do anything thats written after else
I have start session in the beginning of page and script that connects to database, and login panel in every page.. So I log in with my account that has "isAdmin" filled in (with value - Y) .. So, when I check if(!$_SESSION['isAdmin']):, it should return false and do what`s after else ..
But it doesn`t.. I tryed to echo the variable.. But it shows nothing, as it was empty string..
What do I have to add to the script ? In other pages i`ve used this for checking if user is logged in, and it works...
1 Answer
- Jeff PLv 76 years agoFavorite Answer
If you do var_dump($_SESSION), does it include an "isAdmin" key? If it doesn't, then that means there's some wrong at the top of your script.