Copyright @ 2015-2024 织梦园 版权所有 Power by DedeCms
鲁ICP备15039853号-2

模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
<script language="javascript"> <!-- var closestr=0; function SetFocus() { var df = document.form1; if(df.userid.value == '') df.userid.focus(); else df.userid.select(); } function CheckForm() { var df = document.form1; if(df.userid.value == '') { alert('请输入用户名!'); df.userid.focus(); return false; } if(df.pwd.value == '') { alert('请输入密码!'); df.pwd.focus(); return false; } if (df.validate.value == '') { alert ('请输入您的验证码!'); df.validate.focus(); return(false); } if (df.vacodes.value == '') { alert ('请输入您的认证码!'); df.vacodes.focus(); return(false); } } //--> </script> |
<form name="form1" id="form1" method="post" action="login.php" onsubmit='return CheckForm();'> <input type="hidden" name="gotopage" value="<?php if(!empty($gotopage)) echo $gotopage;?>" /> <input type="hidden" name="dopost" value="login"/> <ul> <li><span>用户名:</span> <input type="text" name="userid" class="input_out" maxlength="20" style="width:148px;" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"/> </li> <li><span>密 码:</span> <input type="password" name="pwd" class="input_out" maxlength="20" style="width:148px;" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"/> </li> <li><span>认证码:</span> <input type="password" name="vacodes" class="input_out" maxlength="20" style="width:148px;" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"/> </li> <li><span>验证码:</span> <input name="validate" type="text" id="vdcode" style="width:50px;text-transform:uppercase;" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" class="input_out"/> <img id="vdimgck" src="../include/vdimgck.php" alt="看不清?点击更换" align="absmiddle" style="cursor:pointer" onclick="this.src=this.src+'?'"/></li> <span> </span> <input name='Submit' type='image' style='width:60px; HEIGHT: 25px;' src='img/submit.gif' width='60' height='27'/> </li> </ul> </form> |
if (!emptyempty($userid) && !emptyempty($pwd)) { $res = $cuserLogin->checkUser($userid, $pwd); //success if ($res == 1) { //里,如下。 if (!emptyempty($userid) && !emptyempty($pwd)) { $res = $cuserLogin->checkUser($userid, $pwd); //success if ($res == 1) { //嵌套到这里面! $uservacodes = $_POST['vacodes']; //取出vacodes内容放入另一个变量 if ($uservacodes != '认证码自定义') { //自行修改认证码自定义内容! ResetVdValue(); ShowMsg('认证码不正确!', 'login.php', 0, 1000); //不等于跑这里 die; www.111cn.net } else { //等于就跑这里 $cuserLogin->keepUser(); if (!emptyempty($gotopage)) { ShowMsg('成功登录,正在转向管理管理主页!', $gotopage); die; } else { $uservacodes = $_POST['vacodes']; ShowMsg('成功登录,正在转向管理管理主页!', 'index.php'); die; } } |