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

📄 gb_save.asp

📁 报名系统
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#INCLUDE file="config.asp" -->
<!--#INCLUDE file="guest_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,BookYoubian,Bookemail,Bookoicq,Bookicq,Bookzhuanyie,Bookurl

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

BookContent =  txtToURL(BookContent)

if trim(BookName) = "" then  
       MESSAGE("<li>名字必须填写,你总不能没名吧?请按返回重新填写!</li>")
       Response.End 
end if

if trim(Bookzhuanyie) = "" then  
       MESSAGE("<li>必须选择专业,请按返回重新填写!</li>")
       Response.End 
end if

if trim(Bookold) = "" then  
       MESSAGE("<li>年龄必须填写,你总得让我知道你多大了吧?请按返回重新填写!</li>")
       Response.End 
end if

if trim(Booksex) = "" then  
       MESSAGE("<li>性别必须选择是男还是女,请按返回重新填写!</li>")
       Response.End 
end if


if trim(Bookplace) = "" then  
       MESSAGE("<li>家庭详细地址必须写上,请按返回重新填写!</li>")
       Response.End 
end if


if trim(Bookurl) = "" 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")("BookYoubian")= trim(Request.Form("youbian"))
       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")("Bookzhuanyie")=  trim(request.form("zhuanyie"))
       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("邮编") = BookYoubian
        ASPBook("性别") = Booksex
        ASPBook("OICQ") = Bookoicq
        ASPBook("ICQ")  = Bookicq
        ASPBook("专业")  = Bookzhuanyie
        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 "ok.ASP","谢谢你的报名咨询!我们会尽快与您联系的,希望你能成为大连天龙计算机专修学校的学生。"
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 "gl.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 "gl.asp?page=" & Request("page") & "","已成功的删除了该报名信息."
end if
%>

⌨️ 快捷键说明

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