ECShop支持用户名、邮箱或手机号码登录

  • 时间:
  • 浏览:0
  • 来源:大发快3_快3教程_大发快3教程

  有不少人总要找支持ECShop用户名、邮箱或手号码登录插件,下面就讲一下怎么能能实现用户名、邮箱或手机号码登录ECShop。

  找到user.php 的以下代码:

if (empty($_POST['captcha']))

{

show_message($_LANG['invalid_captcha'], $_LANG['relogin_lnk'], 'user.php', 'error');

}

  底下增加:

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;

}

  怎么能让在user.php的最底部加带:

function is_telephone($phone){

$chars = "/^13[0-9]{1}[0-9]{8}$|15[0-9]{1}[0-9]{8}$|18[0-9]{1}[0-9]{8}$/";

if (preg_match($chars, $phone)){

return true;

}

}

  OK,大功告成!

ECShop下载:

Tags: ECShop   ECShop登录   ECShop网店系统  
责任编辑:cc120