"")
{
$u_name=safe($_POST['u_name']);
$u_phone=safe($_POST['u_phone']);
$u_content=safe($_POST['u_content']);
if(strlen($u_name)<1)
{
alert("姓名不得为空","");
return;
}
$ti="来自 ".$u_name." 的新留言-".date('Y-m-d',time());
$param=$u_name."|".$u_phone."|".$u_content;
mysql_query("set names utf8");
$sql="select * from product_type where type_name='在线留言'";
$result=mysql_query($sql);
if($row=mysql_fetch_array($result))
{
$type_id=$row['id'];
}
$sql="insert into product (type_id,product_title,product_time,param) values ($type_id,'".$ti."','".time()."','".$param."')";
if(mysql_query($sql))
{
alert("留言成功,我们会尽快与您联系,谢谢","index.html");
return;
}
else
{
alert("操作失败","");
return;
}
}
?>