CBaZ Posted June 17, 2007 Share Posted June 17, 2007 When I use my admin login session to go to the general members area it takes me to login twice to get there. I have seperate permissions for admin and for regulars 1 = admin 0 = regular. this is the php line in question it prevents me from getting there the first time <? if (!isset($_SESSION['logged'])) { // not logged in print "<META HTTP-EQUIV=\"Refresh\" Content=\"0; URL=http://mainsite\index.php\">" or die("QUERY FAILED: " . mysql_error()); exit; } ?> this is what I was trying to do to change it so that it knows what to do with session 0 and session 1 <? if (!isset($_SESSION['permission'] == "1")) && (!isset($_SESSION['permission'] == "0")) { } else { if (!isset($_SESSION['logged'])) { // not logged in print "<META HTTP-EQUIV=\"Refresh\" Content=\"0; URL=http://mainsite/index.php\">" or die("QUERY FAILED: " . mysql_error()); exit; } ?> Quote Link to comment Share on other sites More sharing options...
marcus Posted June 17, 2007 Share Posted June 17, 2007 I wouldn't use 0 as a value for a session, so look at it this way: 1: normal member 2: admin if($_SESSION['permission']){ if($_SESSION['permission'] == 1){ //whatever you want to do with a normal member } if($_SESSION['permission'] == 2){ //whatever you want to do with an admin } } Quote Link to comment Share on other sites More sharing options...
CBaZ Posted June 17, 2007 Author Share Posted June 17, 2007 Basically Admin And Basic users will be using the same code on this page. Therefore all I need is something that includes both permission to be able to view the page. it does not need to be seperate. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.