Welcome to weSEO

Login

Welcome back, nice to see you again.

Register - it's free!

Comment, spread your love, communicate

Welcome back!

Nickname:

Password:

Lost your Password?

Create your new Account

Sign in with Twitter

Nickname:

Mailadress:

Login with your Email Address or Username

Tastatur
Ever had the experience that you tried to Login to a Website but you couldn't remember your Username? If you don't want your Users to go through this your simply have to change 2 lines of code in the checklogin.php

Search for:

Code:
1.
$check = safe_query("SELECT * FROM ".PREFIX."user WHERE username='".$ws_user."'");

Change to:

Code:
1.
$check = safe_query("SELECT * FROM ".PREFIX."user WHERE username='".$ws_user."' OR email='".$ws_user."'");

Search for:

Code:
1.
$check = safe_query("SELECT * FROM ".PREFIX."user WHERE username='".$ws_user."' AND activated='1'");

Change to:

Code:
1.
$check = safe_query("SELECT * FROM ".PREFIX."user WHERE username='".$ws_user."' OR email='".$ws_user."' AND activated='1'");

Wrapping it up

That's it! Your Users can now Login with their Username or their Email Address! You might want to tell them that they have both options now, open templates/login.html and add the information there.


Lovers

Avatar
eggzy - 10.12.2010 - 21:19
Cool little mod ^^

Avatar
mr92 - 27.12.2010 - 17:23
awesome. I do love your short and simple tutorials.
One question: Why aren't these features in the official webspellversions? I think thats a must have to fulfil the common webstandards and it does not seem to be very difficult (;

FlorianLetzel - 17.07.2011 - 12:07
nice!

Please Login to leave a Comment.

Sign in with Facebook Sign in with Twitter