Different Menu Depending on UserName
Posted: Fri Aug 01, 2008 6:22 am
Hi all,
This is my first post and having problems with some php concepts.
If I have a login form and sessions are set so it remembers the name.
How can I have an if statement to change the menu that is displayed.
Eg
or because of the following code do I need to check username and password
if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookpass'])){
$_SESSION['username'] = $_COOKIE['cookname'];
$_SESSION['password'] = $_COOKIE['cookpass'];
}
do they both need to be checked or is the if statement wrong
Cheers
This is my first post and having problems with some php concepts.
If I have a login form and sessions are set so it remembers the name.
How can I have an if statement to change the menu that is displayed.
Eg
Code: Select all
if $_SESSION['username'] = 'admin'{if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookpass'])){
$_SESSION['username'] = $_COOKIE['cookname'];
$_SESSION['password'] = $_COOKIE['cookpass'];
}
do they both need to be checked or is the if statement wrong
Cheers