我看php100 视频上第十一讲上的东西跟着做了个留言板,但是总是出错,不知道为什么,数据库写的没有问题但是总是提交不上去,希望能给解决下,谢谢了,下面的是代码:
<?php
include ("conn.php");
if($_POST[`submit`]){  $sql="insert into mesage(id,user,title,content,lastdate) values (``,`$_POST[user]`,`$_POST[title]`,`$_POST[content]`now())"; mysql_query($sql); echo "发表成功";}?>
<form action="add.php" method="post">用户:<input type="text" name="user" size="10"/ ><br>标题:<input type="text" name="title" size="40"/ ><br>内容:<textarea name="content"></textarea><br><input type="submit" name="submit" value="发表留言"/> </form>
然后这个是连接数据库的php:
<?php
$conn = @ mysql_connect("localhost", "root", "") or die("数据库链接错误");mysql_select_db("bbs", $conn);mysql_query("set names 'GBK'");
?>