index.php页面
代码如下 | 复制代码 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=http://www.111cn.net> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>php jquery check username ajax检查帐号唯一性</title> <link href="../style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> jQuery.ajax({ }
} </script> <style> #tick{display:none} </style> <body> Username: <input name="username" id="username" type="text" /> </body> |
php验证页面,此页面接收到jquery ajax post过来的数据进行验证并返回值
代码如下 | 复制代码 |
<?php # FileName="Connection_php_mysql.htm" // if (eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$username)) { { } |