Notice: Undefined index: submit in E:\xampp\htdocs\add.php on line 3
<?phpinclude("conn.php");if($_POST['submit']){echo$sql="insertintomessage(id,user,tit...
<?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())";
mysql_query($sql);
}
?>
<form action="add.php" method="post">
用户名:<input type="text" size=10 name="user" /><br>
标题:<input type="text" size=20 name="title" /><br>
内容:<textarea name="content"></textarea><br>
<input type="submit" name="submit" value="发布"/>
</form>
希望能得到你帮助 展开
include("conn.php");
if($_POST['submit']){
echo $sql="insert into message (id,user,title,content,lastdate) " .
"values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
mysql_query($sql);
}
?>
<form action="add.php" method="post">
用户名:<input type="text" size=10 name="user" /><br>
标题:<input type="text" size=20 name="title" /><br>
内容:<textarea name="content"></textarea><br>
<input type="submit" name="submit" value="发布"/>
</form>
希望能得到你帮助 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询