ballouta Posted September 30, 2008 Share Posted September 30, 2008 Hello my login code is not working, i couldn't find the problem yet, please help: <?php if($_POST){ $_SESSION['username']=trim($_POST["user"]); $_SESSION['password']=trim($_POST["pass"]); } //check if the username and password exist or not $result=mysql_query("select * from `members` where user COLLATE latin1_bin ='" . $_SESSION['username'] . "' AND pass COLLATE latin1_bin ='" . $_SESSION['password'] . "'"); // retrieve number of rows resulted $num=mysql_num_rows($result); $row = mysql_fetch_array($result); // print login form and exit if failed. if($num > 1){ if ($row[reseller] == 'Y') { //display smthg related to reseller } else { // user not a reseller } } // end if num>1 else { echo "user not found"; } ?> i am getting user not found. WHY? Thank you Link to comment https://forums.phpfreaks.com/topic/126479-solved-login-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 30, 2008 Share Posted September 30, 2008 Start by adding the following two lines immediately after your first <?php tag - ini_set ("display_errors", "1"); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/126479-solved-login-error/#findComment-654028 Share on other sites More sharing options...
revraz Posted September 30, 2008 Share Posted September 30, 2008 My first guess is because you don't start sessions anywhere. Link to comment https://forums.phpfreaks.com/topic/126479-solved-login-error/#findComment-654073 Share on other sites More sharing options...
ballouta Posted September 30, 2008 Author Share Posted September 30, 2008 yes sorry i forgot to start the session thanks alot Link to comment https://forums.phpfreaks.com/topic/126479-solved-login-error/#findComment-654075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.