<?php
//Your check code is here!
//验证成功:返回 1;验证失落败:返回0;

echo 0;
前端页面:html
<!doctype html>
<html lang=\"大众en\"大众>
<head>
<meta charset=\公众utf-8\"大众>
<title>jQuery validation之表单验证</title>
<script src=\公众./jquery-1.11.1.min.js\"大众></script>
<script src=\公众./jquery.validate.min.js\"大众></script>
<script>
$(function () {
$(\公众#login\"大众).validate({
debug:true,//方便调试,表单不会提交,纵然验证成功
rules:{//验证规则
name:{
required:true,
minlength:2,
maxlength:10,
remote:'check.php',//远程验证:通过浏览器的掌握台,查看是否将值通报过去了?
},
password:{
required:true,
rangelength:[2,6],
remote:{
url:'check.php',
type:'post',
data:{//注:默认会发送password信息
name:'hwt'
}
}
}
},
messages:{//提示信息:与rules是\"大众逐一对应\"大众的
name:{
required:'不能为空',
minlength:'最小为2位',
maxlength:'最大为10位',
remote:'用户已存在',
},
password:{
required:'不能为空',
rangelength:'2-6位',
remote:'密码缺点',
}
}
})
});
</script>
</head>
<body>
<form action=\"大众\"大众 method=\"大众get\"大众 id=\"大众login\"大众>
用户名:<input name=\"大众name\"大众 type=\"大众text\公众><br />
密码:<input name=\"大众password\公众 type=\"大众password\公众 /><br />
<input type=\"大众submit\公众 class=\"大众button\公众 value=\公众登录\"大众>
</form>
</body>
</html>