<?php
require_once("../include/common.inc.php");
$validate = $_REQUEST['validate'];
if(empty($validate)) $validate=='';
else $validate = strtolower($validate);
$svali = GetCkVdValue();
$ip = GetIP();
$validate = empty($validate) ? '' : strtolower(trim($validate));
$svali = strtolower(GetCkVdValue());
$ip = GetIP();
if(!isset($uname) || $uname==''){
	echo '<script language="JavaScript">window.alert("请输入姓名");location.href="/"</script>';
	exit();	
}
if(!isset($tel) || $tel==''){
	echo '<script language="JavaScript">window.alert("请输入电话");location.href="/"</script>';
	exit();	
}
if(!isset($email) || $email==''){
	echo '<script language="JavaScript">window.alert("请输入邮箱");location.href="/"</script>';
	exit();	
}
if(!isset($content) || $content==''){
	echo '<script language="JavaScript">window.alert("请输入内容");location.href="/"</script>';
	exit();	
}
$date=date("Y-m-d");
$inQuery = "INSERT INTO `#@__yuyue` (`name`,`hometel`,`email`,`ill`,`ip`,`date`) VALUES ('$uname','$tel','$email','$content','$ip','$date');
;";

if(!$dsql->ExecuteNoneQuery($inQuery)){
	$gerr = $dsql->GetError();
	$dsql->Close();
	ShowMsg("保存数据时出错，请联系管理员！".$gerr,"-1");
	exit();
}
echo '<script language="JavaScript">window.alert("您的留言提交成功,点击确定返回");location.href="/"</script>';
?>