hash1 Posted November 27, 2009 Share Posted November 27, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/183074-login-page-showing-userpass-combo-error-when-they-are-correct/ Share on other sites More sharing options...
.josh Posted November 27, 2009 Share Posted November 27, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/183074-login-page-showing-userpass-combo-error-when-they-are-correct/#findComment-966217 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.