Change users.php
Add on top
if ($user->login ($username, $password, Isset ($_post[' Remember ')))
{
Update_user_info ();
Recalculate_price ();
$ucdata = Isset ($user->ucdata)? $user->ucdata: ";
Show_message ($_lang[' login_success '). $ucdata, Array ($_lang[' back_up_page '], $_lang[' Profile_lnk ']), Array ($back _ Act, ' user.php '), ' info ');
}
Add phone, email login
if (Is_email ($username))
{
$sql = "Select user_name from". $ecs->table (' users '). "Where email= '". $username. "'";
$username _e = $db->getone ($sql);
if ($username _e) $username = $username _e;
}
if (Is_telephone ($username))
{
$sql = "Select user_name from". $ecs->table (' users '). "Where mobile_phone= '". $username. "'";
$username _e = $db->getone ($sql);
if ($username _e) $username = $username _e;
}
Mobile phone Regular
Mobile phone number Verification 1/3/4/7/8
function Is_telephone ($phone) {
$chars = "/^13[0-9]{1}[0-9]{8}$|14[0-9]{1}[0-9]{8}$|15[0-9]{1}[0-9]{8}$|17[0-9]{1}[0-9]{8}$|18[0-9]{1}[0-9]{8}$/ ";
if (Preg_match ($chars, $phone)) {
return true;
}
}
Ecshop Login Support Mobile phone number login, email login