网站中有些地方用到了页面跳转式提示窗,我想修改为弹窗式的,如下修改为何验证码验证不起作用了?错在哪里?应该怎么改?
原先代码如下:
!$this->check_captcha('code') && $this->member_msg(fc_lang('验证码不正确'));
if ($uid = get_cookie('find')) {
$this->member_msg(
fc_lang('验证码发送成功,请注意查收'),
dr_member_url('pflogin/find', array('step' => 2, 'uid' => $uid)),
1);
}
修改后如下:
if (!$this->check_captcha('code')) {
$error = fc_lang('验证码不正确');
} elseif ($uid = get_cookie('find')) {
$this->member_msg(
fc_lang('验证码发送成功,请注意查收'),
dr_member_url('pflogin/find', array('step' => 2, 'uid' => $uid)),
1);
}
求大神帮忙看一下!!
https://file.xunruicms.com/file/bbs/511.html【权斌】11楼
<p>【权斌】11楼</p>
<form method="post" action="" id="myform"> <input name="uid" type="hidden" value="{$uid}" /> <input name="step" type="hidden" value="{$step}" /> {if $step == 1} <div class="tac"> <p>步骤一 输入注册邮箱或手机号码 </p> </div> <div class="mt10"> <select class="easyui-combobox fl" name="name" id="postName" labelPosition="top" style="width:90px;height:50px" data-options="editable:false"> <option {if $_POST['name']=='email'}selected{/if} value="email">邮箱</option> {if $mobile}<option {if $_POST['name']=='phone'}selected{/if} value="phone">手机</option>{/if} </select> <input class="easyui-textbox fl" autocomplete="off" name="value" id="postValue" prompt='请输入注册时的邮箱' style="width:210px;height:50px"> </div> <div class="mt15"> <input class="easyui-textbox fl" id="code" name="code" data-options="iconWidth:'50',prompt:'验证码'" style="width:60%;height:50px"> <span class="fr dib tar easyui-tooltip" title="点击更换验证码" style="width:40%;height:100%;background:rgba(0,0,0,0.6)"><img align="absmiddle" style="cursor:pointer;" onclick="this.src='{dr_member_url('api/captcha', array('width' => '100%', 'height' => 50))}&'+Math.random();" src="{dr_member_url('api/captcha', array('width' => '100%', 'height' => 50))}" /></span> </div> <div class="mt15"> <button type="button" onclick="mysubmit()" class="pf_easyui-linkbutton easyui-linkbutton button-line-blue fs16">获取验证码</button> </div> <script type="text/javascript"> $(document).ready(function () { $("#postName").combobox({ onChange: function (n,o) { var valuePrompt; if (n=="email"){ valuePrompt="请输入注册时的邮箱"; }else if (n=="phone"){ valuePrompt="请输入注册时的手机号"; }; $("#postValue").textbox({ prompt:valuePrompt }) } }); }); function mysubmit() { var post = $("#myform").serialize(); $.ajax({type: "POST",dataType:"json", url: "{dr_now_url()}", data: post, success: function(data) { alert(data.msg); }, error: function(HttpRequest, ajaxOptions, thrownError) { alert(HttpRequest.responseText); } }); } </script> {/if} </form>