用户注册代码(php)

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
</head>
<script type="text/javascript">

$(document).ready(function(){
$("#name").focus();
$("#name").blur(function(){

var a=$("#name").val();
if(a){
$.post("3.php",{"name":a},function(data){
alert(data);
});
}else{
alert("用户名不能为空");
}

});

$("#btn1").click(function(){
var a=$("#name").val();
var b=$("#pwd").val();
var c=$("#sex").val();
var d=$("#class1").val();
var e=$("#tel").val();
$.post("1.php",{"name":a,"pwd":b,"sex":c,"class1":d,"tel":e},function(data){
alert(data);
});
});

});
</script>
<body>
姓名:<input type="text" id="name">
<br>
密码:<input type="password" id="pwd">
<br>
性别
<input type="text" id="sex">


<br>
班级
<input type="text" id="class1">
<br>
联系方式
<input type="text" id="tel">
<button id="btn1">提交</button>
</body>
</html>

原文地址:https://www.cnblogs.com/lichangqing1997/p/7911844.html