Jump to content

[SOLVED] Admin Login


CBaZ

Recommended Posts

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;

}

?>

Link to comment
https://forums.phpfreaks.com/topic/55973-solved-admin-login/
Share on other sites

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
}
}

Link to comment
https://forums.phpfreaks.com/topic/55973-solved-admin-login/#findComment-276476
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.