Monday, 15 August 2011

php - Says that password is incorrect, but it's correct -


I have a problem I have created a system, that I can login from mysql in mySQL with the Libers and Capital letters , But if I try to login with lowercase or capital letters, then it says that my password is wrong, but when I try to log in, the correct alias logs in, then where is the problem?

Here is my code:

  if (isset ($ _ POST ['jungtis'])) {if ($ _ POST ['login_slapyvardis'] = " "& Amp;; & amp; $ Amount; $ _POST ['login_slaptazodis']! =" ") {$ Login_slapyvardis = mysql_real_escape_string ($ _ POST ['login_slipwiredis']); $ Login_slaptazodis = mysql_real_escape_string ($ _ POST ['login-splplazodis']); $ Apsaugotaslogin_slaptazodis = md5 ($ login_slaptazodis); If ($ login_sumazintas == $ mysqlskc ['name']) {$ mysql = mysql_query (select "* urp_gers name = '$ login_slapyvardis'") or die (mysql_error ()); $ Mysqlskc = mysql_fetch_assoc (mysql_query ("Select * ucp_users where name = = ('$ login_slapyvardis')")); $ Login_sumazintas = strtolower ($ login_slapyvardis); $ Mysqli = mysql_fetch_assoc ($ mysql); If ($ mysqli ['password'] == $ apsaugotaslogin_slaptazodis) {$ _SESSION ['logged'] = $ mysqli ['id']; $ Ip = $ _SERVER ['REMOTE_ADDR']; MySQL_query ("UPDATE ucp_users SET lastip = '$ ip' WHERE id = '$ mysqli [id]' '); header (' location: / home ');   

Note : I know that it is better that I need to use PDO or mysqli , but I mysql_ for now only.

You have to fix your query.

  $ mysqlskc = mysql_fetch_assoc (mysql_query "SELECT * FROM ucp_users where less (name) = lower ('$ login_slapyvardis')"));    

No comments:

Post a Comment