找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 91|回复: 0

[cms教程] ecshop支持用户名,邮箱或手机号码登录

[复制链接]

该用户从未签到

发表于 2018-5-19 13:43:00 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

×
ecshop支持用户名,邮箱或手机号码登录
看到网上好多人都在找支持用户名,邮箱或手号码登录的插件,发布出来与大家共享下。
在user.php 的
[ol,if (empty($_POST['captcha',)){show_message($_LANG['invalid_captcha',, $_LANG['relogin_lnk',, 'user.php', 'error');}[/ol,
后面增加:
[ol,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;}[/ol,
在user.php的最底部加:
[ol, 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;}}[/ol,
回复

使用道具 举报

网站地图|页面地图|文字地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2024-9-30 03:32

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表