迅睿CMS发送手机验证码开发教程
用在二次开发时,处理验证码发送程序,适合精通php的程序员
模板代码:
<div class="form-group" id="dr_row_code"> <label class="col-md-2 control-label">图片验证</label> <div class="col-md-10"> <div class="input-group input-large"> <input class="form-control placeholder-no-fix" type="text" autocomplete="off" id="dr_code" name="code"> <div class="input-group-btn fc-code"> {dr_code(120, 35)} </div> </div> </div> </div> <div class="form-group" id="dr_row_sms"> <label class="col-md-2 control-label">短信验证</label> <div class="col-md-10"> <div class="input-group input-large"> <input class="form-control placeholder-no-fix" type="text" autocomplete="off" id="dr_sms" name="sms"> <div class="input-group-btn"> <button class="btn blue" onclick="dr_ajax_url('/index.php?s=member&c=api&m=send_code&&code='+$('#dr_code').val()+'&id='+$('#dr_phone').val())" type="button">获取手机验证码</button> </div> </div> </div> </div>
id传递手机号码
程序判断部分:
$code = \Phpcmf\Service::L('Form')->get_mobile_code($phone); if (!$code) { $this->_json(0, dr_lang('没有发送验证码')); } elseif ($code != $_POST['sms']) { $this->_json(0, dr_lang('验证码不正确')); }
本文网址:https://www.dedexuexi.com/jzjc/xrjc/eckf/3533.html
本站部分文章搜集与网络,如有侵权请联系本站,转载请说明出处。