View Single Post
Old 10-12-2012, 11:13 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
PHP Code:
// Register $myusername, $mypassword and redirect to file "login_success.php"
$_SESSION['myusername']=$myusername;

// $_SESSION['LoggedIn'] = 1;
header("location:main.php"); 
That should be something like


PHP Code:
$_SESSION['myusername']=$myusername;
$row=mysql_fetch_assoc($result);
if(
$row['usergroup']==1)
header("location:main.php");
else
header("location:admin_main.php"); 
PS: You'd need to add proper checks on top of all protected pages to ensure the usergroup status of the user when accessing them.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote