请教下面代码错在哪里啊?! <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="t 5
<?phpinclude("lnk.php");if(isset($_POST['submit'])&&$_POST['submit']){$sql="insertint...
<?php
include("lnk.php");
if(isset($_POST['submit']) && $_POST['submit']) {
$sql="insert into `massage` (`id`,`user`,`title`,`content`,`lastdate`)"."values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
$query=mysql_query($sql);
if($query)
{
echo "数据提交成功!";
}
else
{
echo "数据提交失败!";
}
}
?>
<form action="add.php" method="post" name="form">
<fieldset>
<legend>用户名与标题</legend>
<label for="user">用户名:</label>
<input type="text" size="10" name="user">
<br/>
<label for="user">标题:</label>
<input type="text" size="10" name="title">
</fieldset>
<br/>
<fieldset>
<legend>欢迎您留言</legend>
<label for="content">您的金玉良言:</label>
<br/>
<textarea cols="48" rows="10" name="content">
</textarea>
</fieldset>
<input type="submit" value="发布" name="submit" />
<input type="reset" value="重写"name="reset" />
</form> 展开
include("lnk.php");
if(isset($_POST['submit']) && $_POST['submit']) {
$sql="insert into `massage` (`id`,`user`,`title`,`content`,`lastdate`)"."values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
$query=mysql_query($sql);
if($query)
{
echo "数据提交成功!";
}
else
{
echo "数据提交失败!";
}
}
?>
<form action="add.php" method="post" name="form">
<fieldset>
<legend>用户名与标题</legend>
<label for="user">用户名:</label>
<input type="text" size="10" name="user">
<br/>
<label for="user">标题:</label>
<input type="text" size="10" name="title">
</fieldset>
<br/>
<fieldset>
<legend>欢迎您留言</legend>
<label for="content">您的金玉良言:</label>
<br/>
<textarea cols="48" rows="10" name="content">
</textarea>
</fieldset>
<input type="submit" value="发布" name="submit" />
<input type="reset" value="重写"name="reset" />
</form> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询