好吧,我的代码有问题:
if ($_POST) {
//send confirmation email (or insert into database, etc...)
if(isset($_POST['del'])) {
$Link = $_POST['del_link'];
$query = "UPDATE comentarios SET del = '1' WHERE id = '".$Link."'";
mysql_query($query) or die ('Error: ' . mysql_error());
//header('Location: http://google.es'); //For debug
}
}
echo '<form name="del" method="post">
<input type="hidden" name="del_link" value="'.$rowComen['id'].'" />
<a href="#" onclick="get_form(this).submit(); return false;">Delete</a>
</form>';
但是当我按下链接时,网络会刷新,仅此而已......
我曾尝试过:header('Location: http://google.es');
但我不重定向到谷歌......
而且我不知道问题是在帖子中还是在查询中......