php 表单提交问题
<html><metahttp-equiv="content-type"content="text/html"charset="utf-8"/><bodystyle="f...
<html>
<meta http-equiv="content-type" content="text/html" charset="utf-8" />
<body style="font-size: 12px">
<?php
error_reporting(E_ALL &~E_NOTICE);
$link =@mysql_connect("localhost","root","root")
or die("Could not connect:".mysql_error());
@mysql_select_db("test");
mysql_query("set names utf8");
if (!empty($_POST["1"]))
{
mysql_query("insert into test02 set title='{$_POST['title']}',content='{$_POST['content']}'");
}
if(isset($_GET['action'])&&isset($_GET['id']))
{
mysql_query("delete from test02 where id={$_GET['id']}");
}
$rs = mysql_query('select *from test02');
while($row = mysql_fetch_array($rs)) {
?>
标题:<?php echo $row['title'] ?> <br/>
内容:<?php echo $row['content'] ?> <br/>
<a href="12-12-1.php?action=delete&id=<?php echo $row['id']; ?>">删除</a>
<hr/>
<?php
}
?>
<form method="POST" action="12-12-1.php">
发表留言:
<br/>
<br/>
标题:<input type="text" value="" name="title">
<br/>
<br/>
内容:<textarea cols="20" rows="4" name="content"></textarea>
<br/>
<br/>
<input value="提交" name="1" type="submit">
</form>
</body>
</html>
submit 提交无反应 请问是那里出错了 展开
<meta http-equiv="content-type" content="text/html" charset="utf-8" />
<body style="font-size: 12px">
<?php
error_reporting(E_ALL &~E_NOTICE);
$link =@mysql_connect("localhost","root","root")
or die("Could not connect:".mysql_error());
@mysql_select_db("test");
mysql_query("set names utf8");
if (!empty($_POST["1"]))
{
mysql_query("insert into test02 set title='{$_POST['title']}',content='{$_POST['content']}'");
}
if(isset($_GET['action'])&&isset($_GET['id']))
{
mysql_query("delete from test02 where id={$_GET['id']}");
}
$rs = mysql_query('select *from test02');
while($row = mysql_fetch_array($rs)) {
?>
标题:<?php echo $row['title'] ?> <br/>
内容:<?php echo $row['content'] ?> <br/>
<a href="12-12-1.php?action=delete&id=<?php echo $row['id']; ?>">删除</a>
<hr/>
<?php
}
?>
<form method="POST" action="12-12-1.php">
发表留言:
<br/>
<br/>
标题:<input type="text" value="" name="title">
<br/>
<br/>
内容:<textarea cols="20" rows="4" name="content"></textarea>
<br/>
<br/>
<input value="提交" name="1" type="submit">
</form>
</body>
</html>
submit 提交无反应 请问是那里出错了 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询