手机短信验证登录,贴出来方便以后查看!需要的程序员们可以借鉴!注册也是这套逻辑!
//前台代码
<ul class="signlist J_box" style="display:none;">
<form method="post">
<!--手机验证码登录-->
<li class="itembd"><i class="user"></i><input type="text" name="mobile" value="" placeholder="手机号" /></li>
<li class="itembd"><i class="pwd"></i><input type="text" name="code" value="" placeholder="手机验证码" />
<a href="javascript:void(0);" οnclick="U_Mobilereg(this);" class="btn_a">获取验证码</a></li>
<li><a href="{:U('user/findpwd')}" class="blue f_r">忘记密码?</a><input type="checkbox" checked="checked" class="check" />记住我</li>
<li><input type="button" value="登录" class="btn" οnclick="uJdoPost(this);" data-url="{:U("user/logins")}" /></li>
</form>
</ul>
//js代码获取验证码
function U_Mobilereg(self) {
var form = $(self).parents('form'), mobile = form.find('input[name="mobile"]').val();
if ($.zyb.util.empty(mobile)) {
$.zyb.tip({content: '请输入手机号码', icon: 'error'});
ret