Is their no real common reason for that to show up then?
Wish I could remember where I was with that problem.
So I will start at the start.
logcheck.php (used in every admin page)
require_once('vars.php');
require_once('includes/function.php');
if(!empty($_SESSION['smile-email'])){
$query = "SELECT * FROM users WHERE email='".$_SESSION['smile-email']."'";
$fetch = DB::fetch($query);
if($_SESSION['smile-password'] == $fetch[password]){
echo "You're Logged in as ";
echo $fetch['firstname'];
echo " ";
echo $fetch['surname'];
}else{
header('Location: login.php');}
}else{
echo 'Login check failed';
echo '<meta http-equiv="refresh" content="0;url=login.php" />';
exit();
}
login.php
include('../vars.php');
require_once('includes/function.php');
echo "<html><head><title>";
echo $title;
echo "</title><link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"admin.css\" />";
echo "</head><body>";
echo "<table><tr><td>";
$form = '<div id="login-box">';
$form .= '<form action="'.$domain.'admin/login.php" method="post">';
$form .= '<table id="login-table"><tr><td class="col1">';
$form .= 'Email:</td><td class="col2"><input type="text" name="email" id="login-username"/></td></tr>';
$form .= '<tr><td class="col1">Password:</td><td class="col2"><input type="password" name="password" id="login-password"/></td></tr>';
$form .= '<tr><td></td><td align="right"><input type="submit" value="Login" /></td></tr>';
$form .= '</table>';
$form .= '</form></div>';
if(!empty($_POST['email'])){
$query = "SELECT * FROM users WHERE email='$_POST[email]'";
$fetch = DB::fetch($query);
if($_POST['password'] == $fetch['password']){
$query = "UPDATE users SET SessionID='sessionid()'";
$_SESSION['email'] = $_POST['email'];
$_SESSION['password'] = $_POST['password'];
echo 'setting cookies';
echo $_SESSION['email'];
echo $_SESSION['password'];
//echo '<meta http-equiv="refresh" content="0;url=index.php" />';
}else{
echo "Your login details are incorrect";
echo $form;
die();
}
}else{
echo $form;
}
My email is a and password is b... to make it simple right.
But when ever i enter it I get "Your login details are incorrect", I can't see anything wrong with my code?
So I guess I've fucked up my database functions somewhere?
I've got so many files its just getting ridiculous my messy coding doesn't really help fixing problems either.