Jump to content

[SOLVED] Login Error


ballouta

Recommended Posts

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

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.