require('include/common.inc.php'); require('include/ipLocation.class.php'); $myobj=new ipLocation(); if(trim($_POST['content'])){ $_POST['content']=strip_tags($_POST['content']); $_POST['content']=str_replace("\r"," ",$_POST['content']); $_POST['content']=str_replace("\n"," ",$_POST['content']); $q=$db->query("insert into spe_liuyan(id,catid,content,date,ip) values('','".$_POST['catid']."','".$_POST['content']."','".date("Y-m-j H:i:s")."','".$_SERVER['REMOTE_ADDR']."')"); echo 'ok'; } if($_GET['action']=='num' && is_numeric($catid)){ $num=$db->get_one("select count(*) as num from spe_liuyan where catid=$catid"); echo 'document.write("'.$num[num].'");'; } if($_GET['action']=='list' && is_numeric($catid)){ $is_sh = " and shenhe='1'"; if($catid == '2352') $is_sh = ""; $is_sh = ""; if($anum == '') $anum = 3; $infos=$db->select("select * from spe_liuyan where catid=$catid $is_sh order by id desc limit $anum"); $num=count($infos); for($i=0;$i<$num;$i++){ $address=$myobj->getaddress($infos[$i]['ip']); echo 'document.write("