发新话题
打印

php的问题

php的问题

下面一段为什么不能向服务器天加记录啊??
<html>
<body>
<?php
if ($submit) {

$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);

$sql = "INSERT INTO employees (first,last,address,position)
VALUES ('$first','$last','$address','$position')";

$result = mysql_query($sql);

echo "Thank you! Information entered.\n";
} else{
?>

<form method="post" action="<?php echo $PATH_INFO?>">
名:<input type="Text" name="first"><br>
姓:<input type="Text" name="last"><br>
住址:<input type="Text" name="address"><br>
职位:<input type="Text" name="position"><br>
<input type="Submit" name="submit" value="输入信息">
</form>

<?php
}
?>
</body>
</html>      
linux 我来了!!

TOP

发新话题