"
Call HtmlEnd
Response.End
End IF
Select Case Request("action")
Case "click"
Call SLIGHTBOY_Click
Case "add"
Call SLIGHTBOY_Add
Case "post"
Call SLIGHTBOY_Post
Case "super"
Call SLIGHTBOY_Super
Case "admin"
Call SLIGHTBOY_Admin
Case "del"
Call SLIGHTBOY_Del
Case Else
Call SLIGHTBOY_Look
End Select
Sub SLIGHTBOY_Look
Call HtmlStart
'建立数据库连接
Dim Conn,Sql,Rs,TotalRecord,MaxPage,OrderPage
Set Conn=server.CreateObject("adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
'建立活动游标
Sql = "Select id,name,sex,age,birth,live,counter From wish Order BY id DESC"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,conn,1,1
TotalRecord=Rs.RecordCount
Rs.PageSize=Show
MaxPage=Rs.pagecount
OrderPage=Clng(Request("page"))
IF OrderPage="" or OrderPage=0 then
OrderPage=1
ElseIF OrderPage > MaxPage Then
OrderPage=MaxPage
End IF
%>
"&chr(13)
IF Session("WishAdmin")=True Then
Response.Write ""
End IF
%>
<%
Call HtmlEnd
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Click
Call HtmlStart
'建立数据库连接
Set Conn=server.CreateObject("adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
'建立活动游标
Sql = "Select * From wish Where id="&Clng(Request.Querystring("number"))
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,conn,1,3
birth=Rs("birth")
msg=Rs("msg")
IF Rs("sex")="m" Then
sexpic="先生"
Else
sexpic="小姐"
End IF
IF Rs("email")<>"" Then
info= Rs("age")&"岁的 "&Rs("name")&" "&sexpic&",来自"&Rs("live")&",于"&Rs("date")&" 留下此愿"
Else
info= Rs("age")&"岁的 "&Rs("name")&" "&sexpic&",来自"&Rs("live")&",于"&Rs("date")&" 留下此愿"
End IF
Rs("counter")=Rs("counter")+1
Rs.Update
Rs.Close
Set Rs=Nothing
conn.Close
Set conn=Nothing
%>
<%=msg%>
<%=info%>
<%
Call HtmlEnd
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Admin
IF Request.Form("id")="" Then Error("您忘了填写名字")
IF Request.Form("passid")="" Then Error("您忘了填写密码")
IF Instr("'",Request.Form("id")) or Instr("""",Request.Form("id")) or Instr("'",Request.Form("passid")) or Instr("""",Request.Form("passid")) Then Error("名字或密码中含有非法字符")
IF Request.Form("id")=userid or Request.Form("passid")=userpass Then
Session("WishAdmin")=True
Response.Redirect "wish.asp"
Else
Error("密码错误")
End IF
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Post
IF Request.Form("name") = "" Then Error("您忘了填写名字")
IF Instr("'",Request.Form("name")) or Instr("""",Request.Form("name")) Then Error("您名字带有非法字符 PS:名字中不能带有 ' 或者 """)
IF Request.Form("sex") = "" Then Error("您忘了选择性别")
Call CkAge(Request.Form("age"))
IF Request.Form("live") = "" Then Error("您忘了选择居住地")
IF Request.Form("birth") = "" Then Error("您忘了选择愿望类别")
IF Request.Form("msg") = "" Then Error("您忘了填写愿望")
IF maxmessage = "" or maxmessage > 255 Then maxmessage=255
IF Len(Request.Form("msg"))> maxmessage Then Error("您的愿望太长了")
IF use_html="ON" Then
msg=HTMLcode(Request.Form("msg"))
Else
msg=HTMLEncode(Request.Form("msg"))
End IF
IF usr_fltbadword="ON" Then msg=CkBadWords(msg)
StrEmail=Request.Form("email")
'IF StrEmail<>"" Then
' IF chkemail(StrEmail)=False Then Error("请输入正确信箱地址")
'End IF
Set Conn=server.CreateObject("adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
Sql = "Select TOP 1 * From wish Order BY id DESC"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,conn,1,3
IF Rs.Eof Then
Rs.AddNew
Rs("name")=Request.Form("name")
Rs("name")=Request.Form("name")
Rs("sex")=Request.Form("sex")
Rs("age")=Request.Form("age")
Rs("birth")=Request.Form("birth")
Rs("email")=StrEmail
Rs("live")=Request.Form("live")
Rs("msg")=msg
Rs("date")=now+time_ctrl
Rs.Update
Else
IF Rs("msg")=msg Then
Error("请勿重覆许同一个愿")
Else
Rs.AddNew
Rs("name")=Request.Form("name")
Rs("sex")=Request.Form("sex")
Rs("age")=Request.Form("age")
Rs("birth")=Request.Form("birth")
Rs("email")=StrEmail
Rs("live")=Request.Form("live")
Rs("msg")=msg
Rs("date")=now+time_ctrl
Rs.Update
End IF
End IF
Rs.Close
Set Rs=Nothing
conn=Close
Set conn=Nothing
Response.Write ""&title&""&_
""&_
"
诚心祈求...
"
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Del
IF Session("WishAdmin")<>True Then Error("不要捣乱奥")
IF Request("del")<>"" Then
DeleteID=Split(Request("del"),",")
Set Conn=server.CreateObject("adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
For i = 0 to Ubound(DeleteID)
Sql="delete from wish where id="&DeleteID(i)
conn.execute(Sql)
Next
conn.close
Set conn=Nothing
End IF
Response.Redirect"wish.asp"
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Add
Call HtmlStart
%>