<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xm
<head>
<ti
<me
<li
<sc
<sc
<st
body{background: #E9E9E9;}
</st
<sc
<!--
$(function(){
$('#form1').ajaxForm({
beforeSubmit: checkForm,
success: complete,
dataType: 'json'
});
function complete(data){
if (data.status==1){
window.location.href = "{:U('Index/index')}";
}else{
alert(data.info);
var timenow = new Date().getTime();
var url="{:U('Public/verify',array('t'=>'"+timenow+"'))}";
$('#verifyImg').attr('src',url);
}
}
function checkForm(){
if( '' === $.trim($('#account').val())){
//$('#result').html('用户名不能为空!').show();
alert('用户名不能为空!');
return false;
}
if( '' === $.trim($('#password').val())){
//$('#result').html('密码不能为空!').show();
alert('密码不能为空!');
return false;
}
if( '' === $.trim($('#verify').val())){
//$('#result').html('验证码不能为空!').show();
alert('验证码不能为空!');
return false;
}
}
$('#verifyImg').click(function(){
//重载验证码
$('#verifyImg').attr('src',"{:U('Public/verify',array('t'=>time()))}");
});
});
//-->
</sc
</head>
<body>
<div class="login">
<div class="version">微信公众账号导航版</div>
<form method='post' name="login" id="form1" action="{:U('Public/checkLogin')}" >
<div class="loginbox">
<label>用户名:</label><input type="text" class="ipt3" id="account" name="account">
<label>密 码:</label><input type="password" class="ipt3" id="password" name="password">
<label>验证码:</label><input type="text" class="ipt2" id="verify" name="verify"><img id="verifyImg" src="{:U('Public/verify')}" border="0" alt="点击刷新验证码" st
<input type="hidden" name="ajax" value="1">
<input type="submit" id="submit" value="登 录" class="btn4">
</div>
</form>
<div id="result" class="red"></div>
<div class="shuom">在操作过程中如果有问题,可以联系鱼福网寻求帮助!<a href="http://www.yufu5.com" target="_blank">www.yufu5.com</a></div>
</div>
</body>
</html>
最佳答案