Jump to content

Login page showing "user/pass combo" error when they are correct


hash1

Recommended Posts

Hey guys im working on a script and when ever I try to login it is shooting up an error but the username/password are in fact correct.

 

<?
if(isset($_POST['submit'])){
require('config.inc.php');
require('functions.inc.php');
$email = $_POST['email'];
$pass = $_POST['pass'];
$errors = array();
if($email == ""){
$errors[] = "You forgot to enter a email";
}
else{
$email = mysql_real_escape_string($email);
}

if($pass == "") {
$errors[] = "You forgot to enter a password";
}
else{
$pass = mysql_real_escape_string($pass);
}


if(empty($errors)){
$id = check_login($email,$pass,$siteid);
if($id['login'] == 0){
	$errors[] = "The email and password combination is incorrect";
	}
if($id['login'] == 2){
	$errors[] = "You have been banned from this site, please contact support if you have any question";
	}
}
if ($id['login'] == 1){
session_start();
$_SESSION['userid'] = $id['userid'];
header("Location:members.php");
exit();
}

}
?>
<? include('header.php') ?>
<div id="content_main">
           <h3>Login</h3>
            
<? if(!empty($errors)){
echo '<p class="error"><ul>';
foreach($errors as $msg) echo "<li> $msg </li>\n";
echo '</ul></p>';
}
if($_GET["new"]) echo "Your account has been sucessfully created!";
?>
<? include('login.html'); ?>
</div>
</div>
<? include ('footer.php'); ?>

 

Im really stumped on this one, I hope I presented the question in the right way.

 

Thanks in advanced

echo out your posted vars, make sure the script is getting them.  Look in your check_login function, echo out the query, make sure it has what its supposed to have.  c/p it directly into your db (like phpmyadmin or something), make sure it is returning expected results.  What does your error actually say? Is it your script's custom msg or a php error message?

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.