客户端代码:
<html>
<head>
<title>shurubiaoqian</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script src="jquery-1.7.min.js"></script>
<script>
$(function(){
$("#yan").click(function(){$.post("b.php", { name: "John", time: "2pm" } ,function(data){
data=eval('('+data+')');
for(var pro in data){
document.write(pro+'-----'+data[pro]+'<br />');
}
});
});
});
</script>
</head>
<body>
<table>
<form action="" method="post">
<tr><td>用户名</td><td><input id="na" type="text" name="name1" /></td><td><input type="button" id="yan" value="验证用户名" /></td><td><input style="border:0px;" type="text" id="it" /></td></tr>
<tr><td>用户密码</td><td><input id='ps' type="password" name="password" /></td></tr>
<tr><td>电子邮件</td><td><input type="text" name="email" /></td></tr>
<tr><td colspan="2"><input type="submit" value="用户注册" /></td></tr>
</form>
</table>
<table>
<form action="" method="post">
<tr><td>用户名</td><td><input type="text" name="name" /></td></tr>
<tr><td>用户密码</td><td><input type="password" name="password" /></td></tr>
<tr><td>电子邮件</td><td><input type="text" name="email" /></td></tr>
<tr><td colspan="2"><input type="submit" value="用户注册" /></td></tr>
</form>
</table>
</body>
</html>
服务端代码:
<?php
$json=json_encode($_POST);
echo $json;
?>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。