⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gb_save.asp

📁 在线报名系统通用版2006 管理员密码请在 set.asp中修改 管理员页面为 admin.asp
💻 ASP
字号:


<%@ Language=VBScript %>
<!--#INCLUDE file="set.asp" -->
<!--#INCLUDE file="52725.com_lib.asp" -->
<%
FUNCTION txtToURL(tekst)
Tekst_temp = tekst


Tekst_temp = Replace(Tekst_temp,"<","&lt;")
Tekst_temp = Replace(Tekst_temp,">","&gt;")
Tekst_temp = Replace(Tekst_temp,"chr(13)","<BR>")
Tekst_temp = Replace(Tekst_temp,"#","<BR>")

Tekst_temp = Replace(Tekst_temp,Chr(13),"<BR>")
Tekst_temp = Replace(Tekst_temp,"[","<B>")
Tekst_temp = Replace(Tekst_temp,"]","</B>")

i = 1

While not InStr(i,Tekst_temp,"{") = 0 
start = CInt( InStr(1,Tekst_temp,"{") )
i = start
slutt = CInt( InStr(start,Tekst_temp,"}") )
hole = mid(Tekst_temp,(start),(slutt-start+1))
if InStr(hole,"$") then
	skille = CInt( InStr(start,Tekst_temp,"$") )
	navn = mid(Tekst_temp,(start+1),(skille-start-1))
	link = mid(Tekst_temp,(skille+1),(slutt-skille-1))
	if Left(link,4) = "www." then
	    link = "http://" & link
	end if 'www
	if not InStr(link,"@") = 0 then
	    link = "mailto:" & link
	end if '@
	out_var = "<A HREF=""" & link & """>" & navn & "</A>"
	Tekst_temp = Replace(Tekst_temp,hole,out_var,1,1)
else
	link = mid(Tekst_temp,(start+1),(slutt-start-1))
	if Left(link,4) = "www." then
	    link = "http://" & link
	end if 'www
	if not InStr(link,"@") = 0 then
	    link = "mailto:" & link
	end if '@
	link = "<A HREF=""" & link & """>"
	Tekst_temp = Replace(Tekst_temp,"{",link,1,1)
	Tekst_temp = Replace(Tekst_temp,"}","</A>",1,1)
end if
wend

txtToURL = Tekst_temp
END FUNCTION


dim ASPBook
dim StrSQL
dim BookPassWord

if isempty(Request("from")) then
       MESSAGE("<li>对不起,没有操作请求,因此不能使用。</li>")
       Response.End
end if

if Request.Form("from") = "SaveData" then
dim BookName,Bookold,Booksex,Bookplace,BookContent,BookMsgicon,Bookemail,Bookoicq,Bookicq,Bookurl

BookName      =Request.Form("name")
Bookold       =Request.Form("old")
Booksex       =Request.Form("sex")
Bookplace     =Request.Form("place")
BookContent   =Request.Form("Content")
BookMsgicon   =Request.Form("Msgicon")
Bookemail     =Request.Form("email")
Bookoicq      =Request.Form("oicq")
Bookicq       =Request.Form("icq")
Bookurl       =Request.Form("url")
BookD_Date    =Request.Form("D_Date")

BookContent =  txtToURL(BookContent)

if trim(BookName) = "" or trim(BookContent) = "" then  
       MESSAGE("<li>名字和内容是必须的,请再来一次!</li>")
       Response.End 
end if


if trim(Bookoicq)<>"" then
      if not(isnumeric(Bookoicq)) then 
         MESSAGE("OICQ号码必须是数字,请再来一次!")
         Response.End 
      end if
end if

if trim(Bookicq)<>"" then
      if not(isnumeric(Bookicq)) then 
         MESSAGE("电话号码必须是数字,请再来一次!")
         Response.End 
      end if
end if

if trim(Bookemail)<>"" then
    if instr(Bookemail,"@")<=1 then 
        MESSAGE("你的E-Mail地址都错了,请再来一次。")
        Response.End 
    else
        aemail=right(Bookemail,len(Bookemail)-instr(Bookemail,"@"))
        bemail=right(Bookemail,len(Bookemail)-instr(Bookemail,"."))
        if len(aemail)<=1 then
            MESSAGE("<li>你的E-Mail地址都错了,请再来一次。")
            Response.End 
        end if
        if instr(aemail,".")=0 then
            MESSAGE("<li>你的E-Mail地址都错了,请再来一次。。")
            Response.End
        end if
        if len(bemail)<=1 then
            MESSAGE("<li>你的E-Mail地址都错了,请再来一次。")
            Response.End 
        end if
    end if
end if

       Response.Cookies("UserInfo")("BookName")= trim(Request.Form("name"))
       Response.Cookies("UserInfo")("Bookold")= trim(Request.Form("old"))
       Response.Cookies("UserInfo")("Bookemail")=trim(request.form("email"))
       Response.Cookies("UserInfo")("Bookurl")=  trim(request.form("url"))
       Response.Cookies("UserInfo")("Bookoicq")= trim(request.form("oicq"))
       Response.Cookies("UserInfo")("Bookicq")=  trim(request.form("icq"))
       Response.Cookies("UserInfo")("Booksex")=  trim(request.form("sex"))
       Response.Cookies("UserInfo")("Bookplace")=trim(request.form("place"))
       Response.Cookies("User").Expires=  dateAdd("d", 30, now)


       IPinfo = Request.servervariables("REMOTE_ADDR")
       Set bc = Server.CreateObject("MSWC.BrowserType")   

       StrSQL = "Select * from guest where [随机]='" & Request("D_Date") & "'"

       Set rs2 = conn.Execute(StrSQL)
       If rs2.EOF = True Then
       Set ASPBook = Server.CreateObject("ADODB.RecordSet")
       ASPBook.Open "guest",conn,3,3
        
      
        ASPBook.addnew
        ASPBook("名字") = Server.HtmlEncode(BookName)
        ASPBook("年龄") = Server.HtmlEncode(Bookold)
        ASPBook("来自") = Server.HtmlEncode(Bookplace)
        ASPBook("邮件") = Server.HtmlEncode(Bookemail)
        ASPBook("主页") = Bookurl
        ASPBook("表情") = BookMsgicon
        ASPBook("性别") = Booksex
        ASPBook("OICQ") = Bookoicq
        ASPBook("ICQ")  = Bookicq
        ASPBook("留言") = BookContent
        ASPBook("系统") = bc.browser + " " + bc.version + " " + bc.platform
        ASPBook("IP")   = IPInfo
        ASPBook("随机") = BookD_Date
        ASPBook("留言日期") = cstr(now())
        ASPBook.update
        ASPBook.close
        else
        MESSAGE("<li>您已提交咨询或报名信息,请不要重复提交您的咨询或报名信息!</li>")
        Response.End 
        end if
        conn.Close
        Redirect "index.asp?Page=1","感谢您填写咨询或报名信息!我们会与您联系的。"
end if

if Request.Form("from") = "SaveReply" then '回复存盘

	dim BookReply

        BookPassWord = Request.Form("PassWord")

        if BookPassWord<>PassWord then
              MESSAGE("只有管理员才能回复!")
              Response.End 
        end if

        Response.Cookies("UserInfo")("BookPassWord")=trim(request.form("PassWord"))
        Response.Cookies("User").Expires=  dateAdd("d", 1, now)

        BookReply     = Request.Form("Reply")
        BookMsgicon   = Request.Form("Msgicon")

	Set ASPBook=Server.CreateObject("ADODB.RecordSet")
	ASPBook.open "Select * from guest where ID = " & request("Number"),conn,3,3

	if ASPBook.eof and ASPBook.bof then
             MESSAGE("<li>操作错误,找不到序号为" & request("Number") & "的留言,因此不能进行回复操作!</li>")
             Response.End 
	else
	     ASPBook("Reply")      = TxtToURL(BookReply)
             ASPBook("Reply_Icon") = BookMsgicon
             ASPBook("Reply_Date") = cstr(now())
             ASPBook.update
	end if
	ASPBook.close
	set ASPBook=nothing
	conn.close
	set conn=nothing
        Redirect "index.asp?page=" & Request("page") & "","已成功的回复了该留言."
end if

if Request.Form("from") = "SaveDelete" then '删除存盘

        BookPassWord=request.form("PassWord")

        if BookPassWord<>PassWord then
             MESSAGE("<li>在做什么!</li>")
             Response.End 
        end if

        Response.Cookies("UserInfo")("BookPassWord")=trim(request.form("PassWord"))
        Response.Cookies("User").Expires=  dateAdd("d", 1, now)

	dim lngNumber
	lngNumber=request("Number")
	
        Set ASPBook=server.createobject("adodb.recordset")
        StrSQL="Delete * from guest where ID = " & lngnumber
        conn.Execute StrSQL
        set ASPBook=nothing
        conn.close
        set conn=nothing
	Redirect "index.asp?page=" & Request("page") & "","该报名信息已成功的删除www.52725.com."
end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -