<?php
!function_exists('html') && exit('ERR');
$rsdb=$db->get_one("SELECT * FROM {$pre}article WHERE aid='$id'");
if(!$id){
	showerr("數據不存在");
}
if($step==2)
{
	$rs=$db->get_one("SELECT * FROM `{$pre}report` WHERE `ip`='$onlineip'");
	if(!$web_admin&&($timestamp-$rs[posttime]<30)){
		showerr("請30秒後再舉報信息"); 
	}

	if(!$Type){
		showerr("請選擇一個類型"); 
	}elseif(strlen($myname)>30){
		showerr("你的稱呼不能大于30個字符"); 
	}
	$Title="來自“{$webdb[webname]}”的郵件,你朋友“{$myname}”給你推薦了一篇精彩文章!!";
	
	$rs[email]=$email;
	$content=filtrate($content);
	$Type=filtrate($Type);
	$Content=str_replace("\n","<br>",$Content);

	$db->query("INSERT INTO `{$pre}report` (  `aid` , `type` , `uid` , `name` , `content` , `posttime` , `ip` ) VALUES ('$id','$Type','$lfjuid','$myname','$content','$timestamp','$onlineip')");

	refreshto("$webdb[www_url]/","謝謝你，舉報本條信息!",5);
}

require(PHP168_PATH."inc/head.php");
require(html("report"));
require(PHP168_PATH."inc/foot.php");
?>