Jump to content

[SOLVED] Authenticate confusion


matty

Recommended Posts

Ive started recoding my login/authenticate pages for my game engine, because they were simple.

 

Upon testing what I have so far I have noticed something that confuses me.

 

Say these are my login details.

 

User - Me

Pass- letmein

 

Now it will log me in when i enter them exactly like that. BUT when i log in using the user me ( no capitol M), it gives me a blank screen and does nothing :S

The incorrect password or incorrect user name works, it seems to break with case sensitivity issues.

 

any ideas?

 

$userid=mysql_real_escape_string($userid);
$pass=md5($password);



$login=$db->Execute("SELECT * FROM userdb WHERE username='$userid' AND password = '$pass'",true);

if(!$userid || !$password)
{
error2("field");
exit;
}	
$numusers = $login->fieldcount();
if($numusers == 1){

$user=$login->fields;



	if(($user['username']==$userid)&&($user['password']==$pass)){

 		if($user[verified] == "N"){
 		error2("verify");
 		exit;
 		}

     			if($user[jailtime] > 1){
 			jailerror("jail", $userid);
 			exit;
 			}
     
     
   include "include/newsession.php";
  
   function refresh($loc) 
   {
       echo ("<script type=\"text/javascript\">var timeout=1; setTimeout(\"window.location.replace('" . $loc . "')\", timeout*1000 );</script>"); 
       }

       refresh("loggedin.php");    



       }
}	
else 
{
session_unset();
Echo "You have entered incorrect details";
}

 

I have tried changing this part ...

 

}	
$numusers = $login->fieldcount();
if($numusers == 1){

$user=$login->fields;



	if(($user['use

 

to...

}	

if($user=$login->fields){




	if(($user['use

 

I know I could make it so that players could only use a login name in lower caps, but there must be a way thats hiding from me?

 

Matt

Link to comment
https://forums.phpfreaks.com/topic/54358-solved-authenticate-confusion/
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.