It's wierd I made myself an admin user, and I could login no problems... In phpMyAdmin I can see my username and password. Above me is the SUPERUSER which I am trying to login with. There password is encrypted however... I found an old file which works but I don't want to use it, I want to use the new file I created, maybe I need to add something from here to my new file? Any ideas?
Code:
// EXTRACT USERNAME AND PASSWORD
isset($_POST['username']) ? $strLoginName = addslashes($_POST['username']) : ($strLoginName = "");
isset($_POST['password']) ? $strPassword = scramble(addslashes($_POST['password'])) : ($strPassword = "");
Code:
// SEE IF THEY EXIST IN DATABASE
$query = "select * from tbladministrators where username='" . $strLoginName . "' AND password='" . $strPassword . "'";
$query = $query . " AND dateremoved = '0000-00-00'";
$rs = mysql_query($query);
if(!$rs)
{
mysql_close($dbConnection);
die("Failed to extract member information" . mysql_error());
exit();
}
if(mysql_num_rows($rs) == 0)
{
//the user cannot be found - close the database connection and redirect
mysql_close($dbConnection);
header("location:error.php?error=adminloginfailure");
exit();
}
else
{
//the user can be found. Authenticate and redirect
$_SESSION['administratorLoggedIn'] = true;
$_SESSION['superuser'] = mysql_result($rs,0,"superuser");
closeDatabase($rs, $dbConnection);
header("location:index.php");
}
}
?>