<?php
error_reporting(0);
require_once("../../check.php");
require_once("../../../config.php");
isset($_POST['danhao'])?$danhao=$_POST['danhao']:$danhao=null;
isset($_POST['beizhu'])?$beizhu=$_POST['beizhu']:$beizhu=null;
isset($_POST['url'])?$img=$_POST['url']:$img=null;
$dansql = "select * from dunling_renwu where danhao = '$danhao'";
$gao = mysql_query($dansql,$config);
$g = mysql_fetch_array($gao);
$guzhuusername = $g['username'];
$title = $g['title'];
$danjia = $g['danjia'];
$content = $g['content'];
$beizhu = strip_tags($beizhu);
$beizhu = trim($beizhu);
$beizhu = str_replace("\n","<br/>",$beizhu);
$datetime = time();
$insql = "insert into dunling_renwu_log (danhao,danjia,username,user,img,datetime,beizhu,content,shenhe,title) values ('$danhao','$danjia','$guzhuusername','$username','$img','$datetime','$beizhu','$content','0','$title')";
$inery = mysql_query($insql,$config);
$upsql = "update dunling_renwu set smoney=smoney-'1' where danhao='$danhao'";
$upery = mysql_query($upsql,$config);
mysql_close($config);
echo 'ok';
?>