I've created a simple comment feature for my website. And I'm using sessions to determine who is in the admin group so they can delete comments.
Group ID 1 = Normal User
Group ID 2 = Admin
When I set myself as group 1 and use the delete code below it triggers the "else" which is what I want. But when I set myself as group 2 I still get the "else". I have echoed the $_SESSION['grp'] on the page to make sure the session is set correctly and it is. Anyone know why its not deleting the row correctly ?
PHP Code:include("inc/connect.php");
if(isset($_SESSION['grp']) == 2) {
$row = mysql_real_escape_string($_GET['row']);
$result2 = mysql_query("DELETE FROM messages WHERE mid=$row ") or die(mysql_error());
}else{
header('location: error.php?x=8');
}




Reply With Quote