|
|
 |
<%
'ClassMenu TableShengCity,"form1","shi","0"
Select Case Trim(Request("action"))
Case "add"
Call Add()
Case "addsave"
Call AddSave()
Case "del"
Call Del()
Case Else
Call Main()
End Select
Sub Main()
'===============================================留言簿主页面==================================
%>
| <%ShowPages V_lngPageNo,V_lngTotalPage,7,V_lngTotalRecord,V_intPageSize,True,false%> |
<%
End Sub
Sub Add()
'=================================添加留言=============================
%>
<%
End Sub
Sub AddSave()
'===============================留言内容保存===========================
Dim Title,sex,face,i,PostTime,guestName,guestQQ,guestEmail,guestHomePage,content,sheng,shi,ishidden,youbian
Dim ID,Rs,SQL
PostTime=Session("PostTime")
If PostTime+30/86400 > TimeString Then
ErrMsgInfo="为防止灌水,两次留言间隔最小时间为30秒!"
Response.Redirect("ErrorMsg.asp?action=ErrInfo&ErrMsgInfo="&Server.URLEncode(ErrMsgInfo))
End If
Title=Request("Title")
sex=Request("sex")
ishidden=Request("ishidden")
If ishidden="" then
ishidden=0
End If
guestName=Request("guestName")
guestQQ=Request("guestQQ")
guestEmail=Request("guestEmail")
youbian=Request("youbian")
face=Request("selectimages")
sheng=Request("sheng")
shi=Request("shi")
guestHomePage=Request("guestHomePage")
Content = ""
For i = 1 To Request.Form("body").Count
Content = Content & Request.Form("body")(i)
Next
If Content="" Then
ErrMsgInfo="老大!你不写留言内容,让大家看什么呀!!"
Response.Redirect("ErrorMsg.asp?action=ErrInfo&ErrMsgInfo="&Server.URLEncode(ErrMsgInfo))
End If
If StrLength(Content)>500 Then
ErrMsgInfo="老大!你写那么多不怕累着呀!"
Response.Redirect("ErrorMsg.asp?action=ErrInfo&ErrMsgInfo="&Server.URLEncode(ErrMsgInfo))
End If
ID=LangXia.getAutoID(TableGuestBook,"id")
Set Rs=Server.CreateObject("adodb.Recordset")
SQL="Select * From "&TableGuestBook
Rs.Open SQL,Conn,1,3
Rs.AddNew
Rs("ID")=ID
Rs("Title")=Title
Rs("sex")=sex
Rs("ishidden")=ishidden
Rs("guestName")=guestName
Rs("guestQQ")=guestQQ
Rs("guestHomePage")=guestHomePage
Rs("youbian")=youbian
Rs("face")=face
Rs("sheng")=sheng
Rs("shi")=shi
Rs("guestEmail")=guestEmail
Rs("guestIP")=LangXia.UserTrueIP
Rs("content")=content
Rs("date")=TimeString
Rs.Update
Rs.Close
Set Rs=Nothing
Session("PostTime")=TimeString
Response.Redirect "?action=add"
End Sub
%> |
|