View Single Post
  #103  
Old 05-20-2008, 09:29 AM
  fmoses's Avatar 
fmoses fmoses is offline
Banned
 

Senior Member
  
Join Date: Apr 2008
Posts: 155
 

Default Re: Use E-mail address instead of username 3.5.x & 4.0

Quote:
Originally Posted by B00MER
Use E-mail address instead of username for X-Cart 3.5.x & 4.0.

Let users use either their email address or username to login instead of JUST the username.

Edit include/login.php find:

Code:
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE login='$username' AND usertype='$usertype' AND status='Y'");

Change to:

Code:
$user_data=func_query_first("select * from $sql_tbl[customers] where (login='$username' or email='$username') and usertype='$usertype' and status='Y'");

Should work without troubles on 3.5.x and 4.0.x

this is the code that i'm finding in my x-cart, can i still replace the code with the above code and still have it work, i tried changing it to that above using dreamweaver, and then i couldn't login at all, kept on saying invalid login. Should i be using something else to edit my files? New to this and fumbling my way around. the only difference is the WHERE BINARY STATEMENT Thanks

$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY login='$username' AND usertype='$usertype' AND status='Y'");

I had changed it to this
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY (login='$username' or email='$username') AND usertype='$usertype' AND status='Y'");
Reply With Quote