PHP+AJAX实现无刷新注册(带用户名实时检测)
很多时候,我们在网上注册个人信息,在提交完页面后,总得等待页面刷新来告诉我们注册是否成功,遇到网络差的时候,如果注册了一大串的东西,在经过漫长的等待页面刷新后,得到的确是“您的用户名已被使用”或XXXXXXX不合法,我想大家的心情一定特别不爽,今天就介绍个AJAX实现页面不刷新注册+实时检测用户信息的简单注册程序,希望对大家有所帮助。好的,先看注册界面代码:PHPChina 开源社区门户wW\
h~3Q$B] u
#]8Fc0w9a'qOu/c0<table width="831" border="0" align="center" cellpadding="0" cellspacing="0">
d xa @%r)S7F0 <tr style="display:none">
LR2? Z]P/^5L0 <td height="35" align="center" id="result"> </td>
\e#Dv$uKmT0 </tr>PHPChina 开源社区门户 Fo3Z;Ffd'P0J5I.F
</table>
J1P$\*e@!pr3Qz3]A0<table width="100%" height="256" border="0" align="center" cellpadding="1" cellspacing="1">PHPChina 开源社区门户O[8}&HB vQ
<tr>
d}.n&Bb"t u8YY4J0 <td width="150" align="left" bgcolor="#FFFFFF"> · 用户名称: </td>
5Y9SqP(]0 <td width="310" align="center" bgcolor="#FFFFFF">PHPChina 开源社区门户]l J"ed3P d$|
<input name="username" type="text" class="inputtext" id="username">PHPChina 开源社区门户1YXY)o;PEyA
FG|1H nK x B0 <font color="#FF6633">*</font></td>PHPChina 开源社区门户Xl*iCJZ*i
<td align="left" bgcolor="#FFFFFF" id="check"> 4-16个字符,英文小写、汉字、数字、最好不要全部是数字。</td>PHPChina 开源社区门户 `fSzmu6d3f+sG6e
</tr>PHPChina 开源社区门户d1Bg8af/^*J
<tr>
'TSts p0nT(n0 <td width="150" align="left" bgcolor="#FFFFFF"> · 用户密码:</td>
A}-KB1qn.s0 <td width="310" align="center" bgcolor="#FFFFFF">PHPChina 开源社区门户\Z|(lC'hp VJ!d
<input name="userpwd" type="password" class="inputtext" id="userpwd">PHPChina 开源社区门户.S)Bk$lTf2h'[
PHPChina 开源社区门户(BM(`"}z0s%l:r
<font color="#FF6633">*</font> </td>
xZQh:g4h0 <td align="left" bgcolor="#FFFFFF" id="pwd"> 密码字母有大小写之分。6-16位(包括6、16),限用英文、数字。</td>
7W:QD Y9mH*v w!]k0 </tr>
9A!Mqe+C,w0 <tr>PHPChina 开源社区门户7_a6i6f2Tb7W
<td width="150" align="left" bgcolor="#FFFFFF"> · 重复密码:</td>
#]8Fc0w9a'qOu/c0<table width="831" border="0" align="center" cellpadding="0" cellspacing="0">
d xa @%r)S7F0 <tr style="display:none">
LR2? Z]P/^5L0 <td height="35" align="center" id="result"> </td>
\e#Dv$uKmT0 </tr>PHPChina 开源社区门户 Fo3Z;Ffd'P0J5I.F
</table>
J1P$\*e@!pr3Qz3]A0<table width="100%" height="256" border="0" align="center" cellpadding="1" cellspacing="1">PHPChina 开源社区门户O[8}&HB vQ
<tr>
d}.n&Bb"t u8YY4J0 <td width="150" align="left" bgcolor="#FFFFFF"> · 用户名称: </td>
5Y9SqP(]0 <td width="310" align="center" bgcolor="#FFFFFF">PHPChina 开源社区门户]l J"ed3P d$|
<input name="username" type="text" class="inputtext" id="username">PHPChina 开源社区门户1YXY)o;PEyA
FG|1H nK x B0 <font color="#FF6633">*</font></td>PHPChina 开源社区门户Xl*iCJZ*i
<td align="left" bgcolor="#FFFFFF" id="check"> 4-16个字符,英文小写、汉字、数字、最好不要全部是数字。</td>PHPChina 开源社区门户 `fSzmu6d3f+sG6e
</tr>PHPChina 开源社区门户d1Bg8af/^*J
<tr>
'TSts p0nT(n0 <td width="150" align="left" bgcolor="#FFFFFF"> · 用户密码:</td>
A}-KB1qn.s0 <td width="310" align="center" bgcolor="#FFFFFF">PHPChina 开源社区门户\Z|(lC'hp VJ!d
<input name="userpwd" type="password" class="inputtext" id="userpwd">PHPChina 开源社区门户.S)Bk$lTf2h'[
PHPChina 开源社区门户(BM(`"}z0s%l:r
<font color="#FF6633">*</font> </td>
xZQh:g4h0 <td align="left" bgcolor="#FFFFFF" id="pwd"> 密码字母有大小写之分。6-16位(包括6、16),限用英文、数字。</td>
7W:QD Y9mH*v w!]k0 </tr>
9A!Mqe+C,w0 <tr>PHPChina 开源社区门户7_a6i6f2Tb7W
<td width="150" align="left" bgcolor="#FFFFFF"> · 重复密码:</td>