<?php
include 'conn.php';
if(isset($_POST["submit"]))
{
 @$sql="insert into db1(name,password,email,sex,birthday,mobilephone,userid) values ('$_POST[user]','$_POST[password]','$_POST[email]','$_POST[sex]','$_POST[birthday]','$_POST[mobilephone]','')";
mysql_query($sql);}
?>
<form name="form" action="res.php" method="post">
用户名:<input type="text" name="user"><br>
密码:<input type="password" name="password"><br>
邮箱:<input type="text" name="email"><br>
性别:<input type="text" name="sex"><br>
生日:<input type="text" name="birthday"><br>
手机号码:<input type="text" name="mobilephone"><br>
<input type="submit" value="提交" name="submit">
<input type="reset" value="重新填写">
</form> 

解决方案 »

  1.   

    你在什么地方echo 提示你不存在?给完整代码
      

  2.   

    <form name="form" action="res.php" method="post">
    改成
    <form name="form" action="?" method="post">
    試一下@$sql前边的@去掉,看看会不会报错.
    你这应该是php4吧,如果是php5的话诸如:$_POST[user]要改成$_POST['user']如果你不想被Sql注入的话,建议你研究一下这个函数mysql_real_escape_string
      

  3.   

    @$sql="insert into db1(name,password,email,sex,birthday,mobilephone,userid) values ('$_POST[user]','$_POST[password]','$_POST[email]','$_POST[sex]','$_POST[birthday]','$_POST[mobilephone]','')";
    sql 有问题吧 '$_POST[user]' 改成 '".$_POST[user]."'
    其他类似