这个程序为什么错在哪里
<?php
include("conn.php"); if($_POST['submit']){
echo $sql="insert into message(id,user,title,content,lastdate)".
"values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
}?>
<from action="add.php" method="post" >
用户:<input type="text" size="10" name="user" /><br>
标题:<input type="text" name="title" /><br/>
内容:<textarea name="content" ></textarea><br/> <input type="submit" name="submit" value="发布留言"/> </from>
<?php
include("conn.php"); if($_POST['submit']){
echo $sql="insert into message(id,user,title,content,lastdate)".
"values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
}?>
<from action="add.php" method="post" >
用户:<input type="text" size="10" name="user" /><br>
标题:<input type="text" name="title" /><br/>
内容:<textarea name="content" ></textarea><br/> <input type="submit" name="submit" value="发布留言"/> </from>
values('','$_POST['user']','$_POST['title']','$_POST['content']',now())";
values('','$_POST["user"]','$_POST["title"]','$_POST["content"]',now())";
另外if($_POST['submit'])括号里应该是一个判断语句。
你说的不行
<from action="add.php" method="post" >
用户: <input type="text" size="10" name="user" /> <br>
标题: <input type="text" name="title" /> <br/>
内容: <textarea name="content" > </textarea> <br/> <input type="submit" name="submit" value="发布留言"/> </from>应该是form吧
用户: <input type="text" size="10" name="user" /> <br>
标题: <input type="text" name="title" /> <br/>
内容: <textarea name="content" > </textarea> <br/> <input type="submit" name="submit" value="发布留言"/> </from>
应该是<form>和</form>