<?
error_reporting(0);
//加载常用函数
include_once("../../include/common.php");
//加载分页函数
session_start();
islogin();

$action=$_GET["action"];

if($action=="reply")
{
	$content=$_POST["content"];
	
	$id=intval($_POST["id"]);
	
	//过滤字符串
	$content=str_replace("<","&lt;",$content);
	
	$content=str_replace(">","&gt;",$content);
	
	$content=str_replace("\n","<br>",$content);
	
	$content=str_replace("\"","&quot;",$content);
	
	$content=str_replace("\'","&quot;",$content);
	
	if($content=="" || $id==null)
	{
		echo("参数错误");
		exit();
	}
	
	$sql="update feedback set reply='$content' where id=$id";
	//echo $sql;
	
	$mysql->query($sql);
	
	header("location:../feedback.php");
}

if($action=="del")
{
	$id=intval($_GET["id"]);
	
	if($id==null)
	{
		die("错误参数");
	}
	else
	{
		$sql="delete from feedback where id=$id";
		$mysql->query($sql);
		header("location:../feedback.php");
	}
	
}
?>