<!--#include file="conn.asp"-->
<%Call Head()
dim name,title,text,lianxi,num,num1
IF myid=0 then

name=request("name")
num=request("num")
num1=request("num1")

if num<>num1 then
  Call Error("<card title=""出错""><p>验证码错误,请返回重试！")
  end if
uid=0
else
name=myni
uid=myid

end if
title=request("title")
text=request("text")

lianxi=request("lianxi")

name=forbbs(name)
title=forbbs(title)
text=forbbs(text)
lianxi=forbbs(lianxi)
agent=request.serverVariables("HTTP_USER_AGENT")

if name="" then response.redirect "guestadd.asp?sid="&sid&""

if title="" then response.redirect "guestadd.asp?sid="&sid&""

if text="" then response.redirect "guestadd.asp?sid="&sid&""

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [gbook]",connshop,1,2
dim errr
errr=0
if rs.recordcount>0 then
	if rs("name")=name and rs("text")=text then errr=1
end if
if errr=1 then eer="请不要重复留言，<br/>正在返回留言首页！<br/>"
if errr<>1 then
rs.addnew
rs("name")=name
rs("uid")=uid
rs("title")=title
rs("text")=text
rs("YD_time")=now()
rs("reip")=Request.ServerVariables("REMOTE_ADDR")
if lianxi<>"" then rs("lianxi")=lianxi
rs("agent")=agent
rs.update
end if
rs.close
set rs=Nothing
connshop.close
set connshop=nothing
Call saycarda("发表留言")
%>
<!--#INCLUDE file="../bbs/sy1.asp"-->

<%


if eer="" then
response.write"发表成功，正在返回！<br/>"
else
response.write eer
end if
response.write"----------<br/>"
response.write"<a href=""guestbook.asp?sid="&sid&""">留言首页</a><br/>"
response.write"<a href=""index.asp?sid="&sid&""">返回首页</a><br/>"

%>

<%
call headsay()
%>
