+ -
当前位置:首页 → 问答吧 → 为什么验证账户的PHP放入,使用AJAX. 放在表单中可以实现,但是放在一个HTML中就失效了.

为什么验证账户的PHP放入,使用AJAX. 放在表单中可以实现,但是放在一个HTML中就失效了.

时间:2010-09-28

来源:互联网

首先以下是ajax1.html  如果将以下
if($_POST['submit']=='注册')
    {
        ?>以后的内容改成
<HTML><HEAD><TITLE>新用户注册</TITLE><HEAD>
    <BODY><DIV><FORM METHOD='post' action="x2.php">

    <CENTER>
    <B>新用户注册,点击此处
            <A href=javacript:history.go(-1);>返回</A>
    </B><P>
    用户名:  
    <input type=text name="newname" size=16><BR>
    密码:   
    <input type=password name="newpwd" size=16><BR>
    密码确认: 
    <input type=password name="tbxRePwd" size=16><BR>
    提问: 
    <input type=text name="FPWD" size=16><BR>
    回答: 
    <input type=text name="FPAW" size=16><BR>
    邮箱: 
    <input type=text name="email" size=16><BR>
   
        <input type=submit name="submit" value="确认"> 
        <input type=reset name="reset" value="清除"><BR>
        </CENTER>
    </form></div></body></html>
则可以实现用户验证.但是改成下面的形式就无法实现验证/
如果点击"同意以下服务条款,提交注册信息"这个按钮,将会跳转到空白页无法进行验证.
------------------------------

<?
$name=$_POST["name"];
$pwd=$_POST["password"];
$newname=$_POST["newname"];
$newpwd=$_POST["newpwd"];
$tbxRePwd=$_POST["tbxRePwd"];
$email=$_POST["email"];
$FPWD=$_POST["FPWD"];
$FPAW=$_POST["FPAW"];
$validateNum=$_POST["validateNum"];
   function err_output($errstr="未知错误!")
   {
           echo"<p ALIGN=CENTEER><FONT COLOR=RED SIZE=4>
             <B>$errstr<BR></B>请点击此处
             <A HREF=javascript:history.go(-1);>返回</A>
             </FONT></P>";
        exit();
    }
    $db=mysql_connect("localhost","root","8132150nn")
        or err_output("无法连接数据库!");
    mysql_select_db("sos",$db)
        or err_output("无法连接数据库!");
   
    //点击"登录"按钮,用户登录
    if($_POST['submit']== '登录')
    {
     if(empty($name)||empty($pwd))
     {
        err_output("用户名和密码均不能为空!");
     }
     //进行用户名和密码的检验
     $result=mysql_query("select*from obj where tbxNewAccount='$_POST[name]'");
     //检测用户名
     if(mysql_num_rows($result)!=1)
     {
          err_output("用户名不存在!");
      }
      //检测密码
      else
      {
              $arrUser=mysql_fetch_array($result);
            if($arrUser["tbxPwd"]!=$pwd)
            {
                err_output("密码错误!");
            }
            else
            {

            echo"<TITLE>用户登录成功</TITLE>";
            echo"欢迎".$arrUser["name"].",你已经登录成功!";
            }
        }
        mysql_close($db);
        exit();
    }
    //在新用户注册表单中点击"确认"按钮,添加新用户
        if($_POST['submit']=='确认')
    {
    //检验用户名
    $result=mysql_query("select*from obj where tbxNewAccount='$_POST[newname]'");
    if(mysql_num_rows($result)!=0)
    {
        echo("该用户名已经被注册了,请选择别的用户名!");
    }
    $regex="/^[a-zA-Z][_a-zA-Z0-9]{6,16}$/";
    if($newname==""||!preg_match($regex,$newname))
    {
        err_output("用户名6-16个字符(包括大小写字母、数字、下划线)组成!");
    }
    $regex="/^.{6,13}$/";
    if ($newpwd==""||!preg_match($regex,$newpwd))
    {
        echo("密码含有6-13个字符!");
    }
    //进行密码的检验
    if($newpwd!=$tbxRePwd)
    {
        echo("两次输入的密码不相同!");
    }
    $regex=" /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]w+)*$/";
    if(!preg_match($regex,$email)||$email=="")
    {
        echo("邮箱格式错误!");
    }
   
    //以上皆通过,则可以向数据库中添加记录了
    else
    {

    $sql="insert into obj(id,tbxNewAccount,tbxPwd,tbxEmail,FindPwd,FindPwdAnswer,lastdate)".
   "value('','$_POST[newname]','$_POST[newpwd]','$_POST[email]','$_POST[FPWD]','$_POST[FPAW]',now())";
    mysql_query($sql)or die( mysql_error());
        echo"恭喜你,$newname,您已经注册成功!<BR>";
        echo"请点击此处<A HREF=javacript:history.go(-1);>返回首页</A>";
    }
    mysql_close($db);
    exit();
    }
//点击"新用户注册"按钮,出现新用户注册表单
    if($_POST['submit']=='注册')
    {
        ?>
    <HTML><HEAD><TITLE>新用户注册</TITLE><HEAD>
    <script language="javascript" src="../JQuery/js/jquery.js"></script>
<script language="javascript" src="ajax3.js"></script>
<STYLE>
TD {
    FONT-SIZE: 9pt; font-face: simsun
}
.s02 {
    BORDER-RIGHT: 1px ridge; BORDER-TOP: #ffffff 1px ridge; FONT-SIZE: 9pt; BORDER-LEFT: #ffffff 1px ridge; BORDER-BOTTOM: 1px ridge; BACKGROUND-COLOR: #cccccc
}
TABLE {
    FONT-SIZE: 9pt
}
BODY {
    BACKGROUND-COLOR: #ffffff; font-face: simsun
}
A {
    COLOR: #0f0cbf; TEXT-DECORATION: underline
}
A:hover {
    COLOR: #ff0000; TEXT-DECORATION: none
}
A.a1 {
    COLOR: #ffffff; TEXT-DECORATION: none
}
A.a1:hover {
    COLOR: #eeeeee; TEXT-DECORATION: underline
}
.toptd1
{
    FONT-SIZE: 12px
}
.toptd1 A
{
    COLOR: #495466; TEXT-DECORATION: none
}
.toptd1 A:hover
{
    TEXT-DECORATION: underline
}
INPUT {
    FONT-SIZE: 12px
}
INPUT.Ok { BACKGROUND: url(../Image/reg_ok.gif) #fff no-repeat right top}
INPUT.Warning {}
INPUT.Error {}
INPUT.Normal { BACKGROUND-IMAGE: none; BACKGROUND-COLOR: #fff}
.OkMsg { BORDER-RIGHT: #00be00 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #00be00 1px solid; PADDING-LEFT: 25px; BACKGROUND: url(../Image/standard_msg_ok.gif) #e6ffe6 no-repeat 5px 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #00be00 1px solid; COLOR: #000; PADDING-TOP: 5px; BORDER-BOTTOM: #00be00 1px solid}
.WarningMsg { BORDER-RIGHT: #00a8ff 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #00a8ff 1px solid; PADDING-LEFT: 25px; BACKGROUND: url(../Image/standard_msg_warning.gif) #e2f5ff no-repeat 5px 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #00a8ff 1px solid; COLOR: #000; PADDING-TOP: 5px; BORDER-BOTTOM: #00a8ff 1px solid}
.ErrorMsg { BORDER-RIGHT: #f60 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f60 1px solid; PADDING-LEFT: 25px; BACKGROUND: url(../Image/standard_msg_error.gif) #fff2e9 no-repeat 5px 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #f60 1px solid; COLOR: #000; PADDING-TOP: 5px; BORDER-BOTTOM: #f60 1px solid}
.HintMsg { BORDER-RIGHT: #fff 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #fff 1px solid; PADDING-LEFT: 25px; BACKGROUND-IMAGE: none; PADDING-BOTTOM: 5px; BORDER-LEFT: #fff 1px solid; COLOR: #999; PADDING-TOP: 5px; BORDER-BOTTOM: #fff 1px solid; BACKGROUND-COLOR: transparent}
.HintMsg A:link { COLOR: #666; TEXT-DECORATION: none}
.HintMsg A:visited { COLOR: #666; TEXT-DECORATION: none}
.OkMsg_lite { BORDER-RIGHT: #00be00 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #00be00 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #00be00 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #00be00 1px solid; BACKGROUND-COLOR: #e6ffe6}
.WarningMsg_lite { BORDER-RIGHT: #00a8ff 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #00a8ff 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #00a8ff 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #00a8ff 1px solid; BACKGROUND-COLOR: #e2f5ff}
.ErrorMsg_lite { BORDER-RIGHT: #f60 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f60 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #f60 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f60 1px solid; BACKGROUND-COLOR: #fff2e9}
.TableLeft{ width: 140px; font-size:9pt;}
.TableRight{
    width: 300px;
    color: #FF0000;
}
.userText{
/*控制文本框的边框是红色的实线*/
    border:1px solid red;
    }
.STYLE2 {color: #00FF00}
</STYLE>
<script type = "text/javascript" src="../JQuery/js/jquery.js"></script>
<script type = "text/javascript" src="ajax3.js">
</script>
</head>

<body onpaste="return false;" style="TEXT-ALIGN: center" topMargin="0">
<TABLE class="toptd1" style="COLOR: #495466" cellSpacing=0 cellPadding=0 width=770 align=center border=0>
  <TR bgColor="#ebf2fa" height="24">
    <TD style="PADDING-LEFT: 20px" width=110><A href="http://www.01job.cn/"
      target=_blank>第一招聘网</A></TD>
    <TD style="PADDING-LEFT: 20px" width=500></TD>
    <TD align=right width=260><DIV align=center>[<A href="GerenGetPwd.php" target="_blank">找回密码</A>] [<A href="../Html/FAQ.htm" target="_blank">新手入门</A>] [<A href="ContactMe.php" target="_blank">关于我们</A>]</DIV></TD>

  </TR>
</TABLE>
<div align="center">
  <table width="968" border="0" cellspacing="0" cellpadding="0" style=" width: 968px">
    <tr>
      <td align="center" style=" width: 100px"></td>
      <td style=" width: 768px"><DIV align="center" style="BORDER-RIGHT: #cbcbcb 1px solid; BORDER-TOP: #cbcbcb 1px solid; MARGIN-TOP: 0px; BORDER-LEFT: #cbcbcb 1px solid; WIDTH: 760px; BORDER-BOTTOM: #cbcbcb 1px solid">
    <br>
    <table width="700" height="44" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="95"> </td>

        <td width="449" background="../Image/Reg_02.gif"> </td>
        <td width="156"> </td>
      </tr>
    </table>
    <br>
    <form  method="post" action="x2.php">
    <div id="Content">
        <div style="FONT-SIZE: 12px; WIDTH: 700px; TEXT-ALIGN: left">        (带<FONT color=red>*</FONT>的为必填项)
          <table width="700" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">

            <tr>
              <td bgcolor="#FFFFFF"><table width="700" border="0" cellspacing="0" cellpadding="5">
                <!--DWLayoutTable-->
                <tr>
                  <td width="140" height="32" align="right" class="TableLeft">您想要的用户名:<FONT color=red>*</FONT></td>
                  <td width="148" valign="top"><label>
                  <INPUT tabIndex="1" maxLength="11" name="newname" id="newname" onChange="checknewname()">
                  </label></td>
                  <td width="382" valign="top" class="TableRight"><DIV id="tbxNewAccount_info"></DIV></td>
                </tr>
              </table></td>
            </tr>
          </table>
                     (带<FONT color=red>*</FONT>的为必填项)
                     <table width="700" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
              <td bgcolor="#FFFFFF"><table width="700" border="0" cellspacing="0" cellpadding="5">
                <!--DWLayoutTable-->
                <tr>

                  <TD width=140 height="32" align=right class="TableLeft">密码:<FONT color=red>*</FONT></TD>
                  <td colspan="2" valign="top"><label>
                    <input name="newpwd" type="password" id="newpwd" maxlength="16" onChange="checknewpwd()">
                  </label></td>
                  <td colspan="3" valign="top" class="TableRight"><DIV id="tbxPwd_info"></DIV></td>
                </tr>
                <tr>
                  <TD height="32" align=right class="TableLeft">再次输入密码:<FONT color=red>*</FONT></TD>

                  <td colspan="2" valign="top"><label>
                    <input name="tbxRePwd" type="password" id="tbxRePwd" maxlength="16" onChange="checktbxRePwd()">
                  </label></td>
                      <td colspan="3" valign="top" class="TableRight"><DIV id="tbxRePwd_info"></DIV></td>
                </tr>
                <tr>
                  <TD height="32" align=right class="TableLeft">提示问题:<FONT color=red>*</FONT></TD>
                  <td colspan="2" valign="top">

                    <input name="FPWD" type="text" id="FPWD" maxlength="20" onChange="checkFPWD()">                  </td>
                  <td colspan="3" valign="top" class="TableRight"><DIV id="FindPwd_info"></DIV></td>
                </tr>
                <tr>
                  <TD height="32" align=right class="TableLeft">答案:<FONT color=red>*</FONT></TD>
                  <td colspan="2" valign="top">
                    <input name="FPAW" type="text" id="FPAW" maxlength="20" onChange="checkFPAW()">                  </td>
                  <td colspan="3" valign="top" class="TableRight"><DIV id="FindPwdAnswer_info"></DIV></td>
                </tr>
                <tr>
                  <TD height="32" align=right class="TableLeft">电子邮件地址:<FONT color=red>*</FONT></TD>
                  <td colspan="2" valign="top">
                    <input name="email" type="text" id="email"  onchange="checkemail()">                  </td>

                  <td colspan="3" valign="top" class="TableRight"><DIV id="tbxEmail_info"></DIV></td>
                </tr>
                <tr>
                  <TD height="45" align=right class="TableLeft">验证码:<FONT color=red>*</FONT></TD>
                  <td width="87" valign="top"><input name="validate" type="text" id="validate" size="12" >
                     </td>
                  <td colspan="2" valign="top"><img src="img.php" width="100" height="30" onClick="this.src='img.php?nocache='+Math.random()" style="cursor:hand" alt="点击换一张" /></td>
                  <td width="62" valign="top"><span class="STYLE2">点击换一张.. </span></td>
                  <td width="261" valign="middle" class="TableRight"><DIV id="validateNum_info"></DIV></td>
                </tr>
               
                <tr>
                  <td height="0"></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td height="11"></td>
                  <td></td>
                  <td width="54"></td>
                  <td width="36"></td>
                  <td></td>
                  <td></td>
                </tr>
               
               
               
               
               
              </table></td>
            </tr>

          </table>
         
          <p style="TEXT-ALIGN: center">
            <INPUT tabIndex=11 type="submit" value="同意以下服务条款,提交注册信息" name="Submit"  id="agree">
          </p>
          <TABLE id=table4 cellSpacing=0 cellPadding=0 align=center border=0>
            <TBODY>
              <TR>
                <TD><IMG height=30 src="../images/xd.jpg" width=30 border=0></TD>
                <TD><B><a href="../Html/XieYi.html" target="_blank"><FONT style="FONT-SIZE: 14px" color=#ff0000>阅读服务条款</FONT></a></B></TD>

              </TR>
            </TBODY>
          </TABLE>
        </div>
      </div>
    </form>
  </DIV></td>
      <td align="center" style=" width: 100px"></td>
    </tr>

  </table>
 
</div>
</body>
</html>
<?
}
?>
--------------------

以下建了一些对用户.密码.等的判断PHP
~~~~~~~~~~~~~~~~~~~
//ajax1.php
<?
$name = $_GET['name'];
$db=mysql_connect("localhost","root","")
        or die("无法连接数据库!");
    mysql_select_db("users",$db)
        or die("无法连接数据库!");
     $result=mysql_query("select*from users where name='$name'");
     
     //检测用户名
     $regex="/^[a-zA-Z][_a-zA-Z0-9]{5,16}$/";
       if ($name==""||!preg_match($regex,$name))
       {
       echo("2");
       }else{
     if(mysql_num_rows($result)>=1)
     {
          echo("1"); //用户重复
      }
      else
      {
          echo("0");    //可以使用
      }
       }
      exit();
    ?>   
   
    ~~~~~~~~~~~~~~~~~~~~~~~~
ajax2.php
-------------------------------------------
<?
$name = $_GET['name'];
$db=mysql_connect("localhost","root","8132150nn")
        or die("无法连接数据库!");
    mysql_select_db("users",$db)
        or die("无法连接数据库!");
     $result=mysql_query("select*from users where name='$name'");
     
     //检测用户名
     $regex="/^[a-zA-Z][_a-zA-Z0-9]{5,16}$/";
       if ($name==""||!preg_match($regex,$name))
       {
       echo("2");
       }else{
     if(mysql_num_rows($result)>=1)
     {
          echo("1"); //用户重复
      }
      else
      {
          echo("0");    //可以使用
      }
       }
      exit();
    ?>   
    ----------------------------------------
//ajax20.php
<?
    $pwd = $_GET['pwd'];
     $regex="/^.{6,13}$/";
     if ($pwd==""||!preg_match($regex,$pwd))
     {
        echo("3");
    }else{
        echo("4");
    }
    exit();
    ?>
-----------------
//ajax21.php
<?
    $repw = $_GET['repwd'];
     $regex="/^.{6,13}$/";
     if ($repw==""||!preg_match($regex,$repw))
     {
        echo("5");
    }else{
        echo("6");
    }
    exit();
    ?>
--------------------
//ajax22.php
<?
    $findP = $_GET['findP'];
    $regex="/^.{6,20}$/";
     if ($findP==""||!preg_match($regex,$findP))
     {
        echo("7");
    }else{
        echo("8");
    }
    exit();
    ?>
.............................
//ajax23.php
<?
    $findPa = $_GET['findPa'];
    $regex="/^.{6,20}$/";
    if ($findPa==""||!preg_match($regex,$findPa))
     {
        echo("9");
    }else{
        echo("10");
    }
    exit();
    ?>
-------------------------
//ajax24.php
<?
    $em = $_GET['em'];
    $regex=" /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]w+)*$/";
    if(!preg_match($regex,$em)||$em=="")
    {
        echo("11");
    }else{
        echo("12");
    }
     exit();
     ?>
    ----------------------
//ajax3.js
...........................
 // JavaScript Document
var request = false;
   try {
     request = new XMLHttpRequest();
   } catch (trymicrosoft) {
     try {
       request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (othermicrosoft) {
       try {
         request = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (failed) {
         request = false;
       }
     }
   }

   if (!request)
     alert("Error initializing XMLHttpRequest!");
function checknewname(){
var newname = $("#newname").val();
$.get("ajax2.php?name="+newname,null,function(txt){
if(txt == 0){$("#tbxNewAccount_info").html("<p>此用户名可注册</p>");}
else if(txt == 1) {$("#tbxNewAccount_info").html("<p>此用户已经被注册!</p>");}
else{$("#tbxNewAccount_info").html("<p>用户名6-16个字符(包括大小写字母、数字、下划线)组成!</p>");}
});
}
function checknewpwd(){
var newpwd = $("#newpwd").val();
$.get("ajax20.php?pwd="+newpwd,null,function(txt){
if(txt == 3){$("#tbxPwd_info").html("<p>密码含有6-13个字符</p>");}
else if(txt == 4){$("#tbxPwd_info").html("<p>OK!</p>");}
});
}
function checktbxRePwd(){
var tbxRePwd = $("#tbxRePwd").val();
$.get("ajax21.php?repwd="+tbxRePwd,null,function(txt){
if(txt == 5){$("#tbxRePwd_info").html("<p>两次输入的密码不相同!</p>");}
else if(txt == 6) {$("#tbxRePwd_info").html("<p> </p>");}
});
}
function checkFPWD(){
var FPWD = $("#FPWD").val();
$.get("ajax22.php?findP="+FPWD,null,function(txt){
if(txt == 7){$("#FindPwd_info").html("<p>至少需要6个字符!</p>");}
else if(txt == 8) {$("#FindPwd_info").html("<p>OK!</p>");}
});
}
function checkFPAW(){
var FPAW = $("#FPAW").val();
$.get("ajax23.php?findPa="+FPAW,null,function(txt){
if(txt == 9){$("#FindPwdAnswer_info").html("<p>至少需要6个字符!</p>");}
else if(txt == 10) {$("#FindPwdAnswer_info").html("<p>OK!</p>");}
});
}
function checkemail(){
var email = $("#email").val();
$.get("ajax24.php?em="+email,null,function(txt){
if(txt == 11){$("#tbxEmail_info").html("<p>邮箱格式不正确!</p>");}
else if(txt == 12) {$("#tbxEmail_info").html("<p>OK!</p>");}
});
}
======================
//验证并注入数据库的x2.php
<?
$newname=$_POST["newname"];
$newpwd=$_POST["newpwd"];
$tbxRePwd=$_POST["tbxRePwd"];
$email=$_POST["email"];
$FPWD=$_POST["FPWD"];
$FPAW=$_POST["FPAW"];
$validate=$_POST["validate"];
function err_output($errstr="未知错误!")
   {
           echo"<p ALIGN=CENTEER><FONT COLOR=RED SIZE=4>
             <B>$errstr<BR></B>请点击此处
             <A HREF=javascript:history.go(-1);>返回</A>
             </FONT></P>";
        exit();
    }
    $db=mysql_connect("localhost","root","8132150nn")
        or err_output("无法连接数据库!");
    mysql_select_db("sos",$db)
        or err_output("无法连接数据库!");
       
    //在新用户注册表单中点击"确认"按钮,添加新用户
        if($_POST['submit'])
    {
    //检验用户名
    $result=mysql_query("select*from obj where tbxNewAccount='$_POST[newname]'");
    if(mysql_num_rows($result)!=0)
    {
        err_output("该用户名已经被注册了,请选择别的用户名!");
    }
    $regex="/^[a-zA-Z][_a-zA-Z0-9]{6,16}$/";
    if($newname==""||!preg_match($regex,$newname))
    {
        err_output("用户名6-16个字符(包括大小写字母、数字、下划线)组成!");
    }
    $regex="/^.{6,13}$/";
    if ($newpwd==""||!preg_match($regex,$newpwd))
    {
        err_output("密码含有6-13个字符!");
    }
    //进行密码的检验
    if($newpwd!=$tbxRePwd)
    {
        err_output("两次输入的密码不相同!");
    }
    $regex="/^.{6,20}$/";
    if ($FPWD==""||!preg_match($regex,$FPWD))
     {
        err_output("提示问题至少需要6位字符!");
    }
    $regex="/^.{6,20}$/";
    if ($FPAW==""||!preg_match($regex,$FPAW))
     {
        err_output("回答至少需要6位字符!");
    }
    $regex=" /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]w+)*$/";
    if(!preg_match($regex,$email)||$email=="")
    {
        err_output("邮箱格式错误!");
    }
   
    //以上皆通过,则可以向数据库中添加记录了
    else
    {

    $sql="insert into obj(id,tbxNewAccount,tbxPwd,tbxEmail,FindPwd,FindPwdAnswer,lastdate)".
   "value('','$_POST[newname]','$_POST[newpwd]','$_POST[email]','$_POST[FPWD]','$_POST[FPAW]',now())";
    mysql_query($sql)or die( mysql_error());
        echo"恭喜你,$newname,您已经注册成功!<BR>";
        echo"请点击此处<A HREF=javacript:history.go(-1);>返回</A>";
    }
    mysql_close($db);
    exit();
    }
    ?>
======================
   .困惑了我1个月了..看了PHP100的视频到现在55章还没找到可以解决的方案.希望某个大侠帮帮忙..
   
    ======
还要个问题.用AJAX+PHP+JQuery 如何将我上面输写的ajax1.php,ajax2.php,ajax21.php,ajax22.php,ajax23.php,ajax24.php整合成一个.

作者: cfs40227   发布时间: 2010-09-28

很 困惑 代码好多的 自己先从一个小例子开始做做 就是那个 后台检测用户名那个 一步步来

作者: jerrymsj   发布时间: 2010-09-28