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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.