<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body><script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript" src="ajax1.js"></script>
<form id="form1" name="form1" method="post" action="login.php" onsubmit="ok1()">
  <table width="794" border="1" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="2"><div align="center">用户注册</div></td>
    </tr>
    <tr>
      <td width="348"><div align="right">用户名:</div></td>
      <td width="440"><label>
        <input type="text" name="name" onblur="ok(form1)" />
        <div id="name1" ><font color="#006633"">请输入用户名!</font></div>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">密码:</div></td>
      <td><label>
        <input type="password" name="password" />
  <input name="c_name" type="hidden" value="not" />
  

      </label></td>
    </tr>
    <tr>
      <td colspan="2"><label>
        <div align="center">
          <input type="submit" name="Submit" value="提交" />
          <input type="reset" name="Submit2" value="重置" />
        </div>
      </label></td>
    </tr>
  </table>
</form></body>
</html>
跳转页面
<?php
  
    require_once('Connections/conn.php');
$conn=mysql_connect("localhost","root","root")or die("不能连接到数据库");
if($conn)
{
   echo"数据库连接成功!";
}
$name=$_POST['name'];
$password=$_POST['password'];
$sql="insert into user(name,password) values('$name','$password')";
/*$rst=$conn->execute($sql);*/
    $ret=mysql_query($sql,$conn);
if($ret==false)
{
   echo"失败";
}
else
{
    echo"成功";
}

?>
<?php
  
    require_once('Connections/conn.php');
$conn=mysql_connect("localhost","root","root")or die("不能连接到数据库");
if($conn)
{
   echo"数据库连接成功!";
}
$name=$_POST['name'];
$password=$_POST['password'];
$sql="insert into user(name,password) values('$name','$password')";
/*$rst=$conn->execute($sql);*/
    $ret=mysql_query($sql,$conn);
if($ret==false)
{
   echo"失败";
}
else
{
    echo"成功";
}

?>为什么我把前台数据添加不到数据库中呢。  总是提示数据库连接成功! 失败。。