<?php
/**
* @version $Id: index.php
* @侯爷的博客　www.palmcivet.ren
* @action 显示实例程序
*/
include_once("../include/config.php");//数据库配置文件
include_once("../include/common.php");//公用函数类库文件

$userip = getip();
$userdate = date("Y-m-d");
$linkid = isset($_POST['lm_linkid']) ? cinput($_POST['lm_linkid']) : '';
$mouid = isset($_POST['lm_mouid']) ? cinput($_POST['lm_mouid']) : '';
$nmid = isset($_POST['lm_nmid']) ? cinput($_POST['lm_nmid']) : '';
$linktitle = isset($_POST['linktitle']) ? mb_substr(cinput($_POST['linktitle']),0,20,'utf-8') : '匿名游客';
$content = isset($_POST['content']) ? mb_substr(cinput($_POST['content']),0,200,'utf-8') : '这家伙很懒，什么都没有留下！';
$addsql = "insert into limao_ping(lm_linkid,lm_linktitle,lm_nmid,lm_mouid,lm_content,lm_ip,lm_date) values('".mysql_real_escape_string($linkid)."','".mysql_real_escape_string($linktitle)."','".mysql_real_escape_string($nmid)."','".mysql_real_escape_string($mouid)."','".mysql_real_escape_string($content)."','".mysql_real_escape_string($userip)."','".mysql_real_escape_string($userdate)."')";
mysql_query($addsql);
echo "<script>alert('评论发表成功,等待审核');history.go(-1);</script>";

?>