<?php
	session_start();
	include_once 'conn/conn.php';
	$id=$_POST['id'];
	$cont = $_POST['reviewcont']; 
	$name = $_SESSION['name'];
	if(empty($id) or empty($cont)){
		echo "<script>alert('回复为空，请返回');history.go(-1);</script>";
		exit();
	}
	$insertsql = "insert into tb_mess (content,review,author) values('".$cont."',".$id.",'".(empty($name)?'匿名':$name)."')";
	mysql_query($insertsql);
	if(mysql_affected_rows() == 1){
		echo "<script>alert('回复成功');location='index.php';</script>";
		exit();
	}else{
		echo "<script>alert('有错误，请返回');history.go(-1);</script>";
		exit();
	}
?>