<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="inc/msgbox.asp"-->
<Meta http-equiv="Expires" Content="0">
<Meta http-equiv="Pragma" Content="No-cach">
<Meta name="none" >
<%
oldaddress=request.serverVariables("HTTP_REFERER")
'if oldaddress<>"http://www.35175.com/guestbook/say.asp" then
'msgbox "非法请求","back"
'response.end
'end if
if request.cookies("online")<>"yes" then
response.redirect "../guestbook"
end if
names=request.form("names")
sex=request.form("sex")
QQ=request.form("oicq")
ICQ=request.form("ICQ")
Email=request.form("Email")
HomeUrl=request.form("HomeUrl")
address=request.form("address")
message=request.form("message")
face=request.form("face")
userface=request.form("userface")
IP=request.serverVariables("remote_host")
user_type=session("user_type")
if user_type="" then
user_type="未注册"
end if
if names="" then
msgbox "你怎么连名字都不输啊!","back"
Response.End 
end if
if  trim(message) = "" then  
       msgbox "你怎么不说一句话呢。 ","back"
       Response.End 
end if
if trim(QQ)<>"" then
      if not(isnumeric(QQ)) then 
         msgbox "OICQ号码必须是数字!","back"
         fanhui
         Response.End 
      end if
end if
'第45行
if trim(ICQ)<>"" then
      if not(isnumeric(ICQ)) then 
         msgbox "ICQ号码必须是数字!","back"
         Response.End 
      end if
end if

if trim(Email)<>"" and trim(Email)<>"@" then
    if instr(Email,"@")<=1 then 
        msgbox "对不起,你的E-mail地址有错误，因此不能发表留言，请核对后再试。","back"
        fanhui
        Response.End 
    else
        aEmail=right(Email,len(Email)-instr(Email,"@"))
        bEmail=right(Email,len(Email)-instr(Email,"."))
        if len(aEmail)<=1 then
            msgbox "对不起,你的E-Email地址有错误，因此不能发表留言，请核对后再试。","back"
            fanhui
            Response.End 
        end if
        if instr(aEmail,".")=0 then
            msgbox "对不起,你的E-Email地址有错误，因此不能发表留言，请核对后再试。","back"
           fanhui
            Response.End
        end if
        if len(bEmail)<=1 then
            msgbox "对不起,你的E-Email地址有错误，因此不能发表留言，请核对后再试。","back"
           fanhui
            Response.End 
        end if
    end if
end if
if trim(address)<>"" then
      if isnumeric(address) then 
         msgbox "你住的那里怎么能全部是数字呢!","back"
         fanhui
         Response.End 
      end if
end if
if QQ="" THEN
QQ="0"
end if
IF ICQ="" THEN
ICQ="0"
End if
IF HomeUrl="" then
HomeUrl="None"
end if
IF Email="" then
Email="None"
End if
IF address="" then
address="None"
End if
addmessage
%>
<%
Function  addmessage
startime=timer()
exec="insert into guestbook([names],sex,QQ,ICQ,Email,HomeUrl,[message],face,userface,IP,user_type)values('"+names+"','"+sex+"',"+QQ+","+ICQ+",'"+Email+"','"+HomeUrl+"','"+message+"','"+face+"','"+userface+"','"+IP+"','"+user_type+"')"
conn.execute exec
conn.close
set conn=nothing
msgbox "已经成功留言\n\n感谢您的留言","../guestbook"
end Function
%>