|
user.html内容:
<html>
<head>
<title> TestGuide New User </title>
</head>
<body>
<h1> TestGuide 添加新用户 </h1>
<form action="insert_user.php" method="get">
<table border=0>
<tr>
<td>用户编号</td>
<td><input type=text name=userid maxlength=5 size=13><br></td>
</tr>
<tr>
<td>用户姓名</td>
<td><input type=text name=name maxlength=12 size=13><br></td>
</tr>
<tr>
<td>邮编</td>
<td><input type=text name=zip maxlength=6 size=6><br></td>
</tr>
<tr>
<td>地址</td>
<td><input type=text name=address maxlength=90 size=30><br></td>
</tr>
<tr>
<td>备注</td>
<td><input type=text name=text maxlength=100 size=30><br></td>
</tr>
<tr>
<td colspan=2><input type=submit value="添加"></td>
</tr>
</table>
</form>
</body>
</html>
下面是insert_ueser.php内容:
<?php
if(!$userid || !$name || !$zip || !$address)
{echo "信息没有输入完全,请返回重新输入!";
exit;
}
$userid=addslashes($userid);
$name=addslashes($name);
$zip=addslashes($zip);
$address=addslashes($address);
$text=addslashes($text);
@ $db = mysql_pconnect("localhost","","");
if(!$db)
{echo "无法连接数据库,请稍后重试!";
exit;
}
mysql_select_db("testguide");
$query = "insert into users valuse
('".$userid."','".$name."','".$zip."','".$address."','".$text."')";
$result = mysql_query($query);
if($result)
echo mysql_affected_rows()."新用户已经输入数据库。";
?>
MYSQL数据库已经建好可以用,但在user.html中输入任何信息,insert_user.php总是显示“信息没有输入完全,请返回重新输入”,俺是死活
看不出错在哪里?555555~~~ |
|