I'm setting up access to the admin page.
I have a session variable indicating if they are an admin, superuser or user.
If they are an admin, show all admin commands; if a superuser, only show superuser commands and if user, redirect them to the user page.
The code so far:
if ($_SESSION['useraccess']) =='Admin' {
echo '<h2>Admin Functions:</h2>';
echo 'Add New Admin<br />';
echo 'View All Admins<br />';
echo 'Update Your Details<br />';
echo 'Ban User<br />';
}
else if ($_SESSION['useracess']) =='SuperUser' {
echo '<h2>Member Functions:</h2>';
echo '<a href="addnewmember.php">Add New User</a><br />';
echo '<a href="importmembers.php">Add Bulk Users(CSV)</a><br />';
echo '<a href="emailuser.php">Email Details to single User</a><br />';
echo '<a href="viewmembers.php">View Users/Delete Users/Modify Users</a><br />';
echo 'Email All Users';
}
// else if ($_SESSION['useraccess']) =='User' {
header("location:http://members/main/index.php");
// }
The trouble is I get a parse error whether I use = or ==
"" or '' or nothing at all. It has to be one of those, but which one?
Parse error: syntax error, unexpected T_IS_EQUAL in path.php on line 27
Thanks!