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

📄 speakadd.asp

📁 聊天室源码呵呵你好用~~~~~~2.0版本
💻 ASP
字号:
<%@ LANGUAGE=VBScript%>
<%Server.ScriptTimeout=600
Response.Expires=0
dim input()
name=Trim(Request.Form("name"))
if len(name)>15 then name=left(name,15)
pwd=Request.Form("pwd")
from=Trim(Request.Form("from"))
if len(from)>15 then from=left(from,15)
hideip=Request.Form("hideip")
if hideip<>"1" then hideip="0"
email=Trim(Request.Form("email"))
if len(email)>50 then email=left(email,50)
homename=Trim(Request.Form("homename"))
if len(homename)>20 then homename=left(homename,20)
url=Trim(Request.Form("url"))
if len(url)>50 then url=left(url,50)
baomi=Request.Form("baomi")
if baomi<>"1" then baomi="0"
towho=Trim(Request.Form("towho"))
if len(towho)>15 then towho=left(towho,15)
if towho="" or LCase(towho)="all" then towho="大家"
if towho="大家" then baomi="0"
ly=RTrim(Request.Form("ly"))
if len(ly)>1024 then ly=left(ly,1024)
ip=Request.ServerVariables("REMOTE_ADDR")
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj=n & "年" & y & "月" & r & "日" & " " & weekdayname(weekday(date())) & " " & s & ":" & f & ":" & m
if name="" then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>对不起,尊姓大名不能为空</p><p>没有大名,小名也可以啊</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
if InStr(name,"`")<>0 or InStr(name," ")<>0 or InStr(name," ")<>0 or InStr(name,"'")<>0 or InStr(name,chr(34))<>0 or InStr(name,"\")<>0 then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>对不起,姓名含有不被允许的字符</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
if NOT(LCase(left(url,7))="http://" or url="") then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>请仔细检查你的主页地址</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
if ly="" then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>对不起,留言不能为空</p><p>请留下您的墨宝吧</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
name=server.HTMLEncode(name)
from=server.HTMLEncode(from)
email=server.HTMLEncode(email)
homename=server.HTMLEncode(homename)
url=server.HTMLEncode(url)
if LCase(url)="http://" then url=""
towho=server.HTMLEncode(towho)
ly=server.HTMLEncode(ly)
ly=Replace(ly," ","&nbsp;")
ly=Replace(ly,chr(13)&chr(10),"<br>")
if Instr(ly,"<br><br>")<>0 then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>对不起,留言内容中出现连续的回车符</p><p>即留言中不能有空白行</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
'检测用户名、收信人是否存在,密码是否正确
regnum=Application("a_c_reg_num")
regdata=Application("a_c_reg_data")
nameexist=0
pwdok=0
towhoexist=0
for i=5 to regnum step 8
 if name=regdata(i) then nameexist=1
 if pwd=regdata(i+1) then pwdok=1
 if towho=regdata(i) then towhoexist=1
next
if towho="大家" then towhoexist=1
if nameexist=1 and pwdok=0 then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>密码错误</p><p>不能用“" & name & "”进行留言!</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
if towhoexist=0 and baomi=1 then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>用户名“" & towho & "”不存在</p><p>不能给他(她)私人留言</p>"
 Response.write "<p>请去掉“私人留言”复选框或换名</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
lyfile=server.mappath("speakdata_v200.asp")
Set fs=CreateObject("Scripting.FileSystemObject")
set thisfile=fs.OpenTextFile(lyfile,1,False)
counter=0
do while not thisfile.AtEndOfStream
thisline = thisfile.readline
Redim preserve input(counter)
input(counter) = thisline
counter = counter + 1
loop
thisfile.Close
if counter>1 then
if LCase(ly)=LCase(input(3)) then
 Response.write "<html><head><title>出错提示</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>"
 Response.write "<body bgcolor='#EFC684'><table width='364' cellpadding='10' align='center'><tr align='center'><td>"
 Response.write "<p><font face='黑体' color='#FF0000' style='font-size: 32pt'>出错提示</font></p>"
 Response.write "<p>本留言簿只保留最近300条留言</p><p>相同留言请勿反复粘贴</p><p>谢谢合作</p>"
 Response.write "<p><a href='javascript:history.go(-1)'>点击此处进行修改</a></p>"
 Response.write "</td></tr></table></body></html>"
 Response.end
end if
end if
dim new_index()
Redim Preserve new_index(1),new_index(2),new_index(3)
new_index(1)=baomi
new_index(2)=towho
new_index(3)=name
lyym=0
Set outfile = fs.CreateTextFile(lyfile)
outfile.WriteLine input(0)
outfile.WriteLine baomi
outfile.WriteLine towho
outfile.WriteLine ly
outfile.WriteLine name
outfile.WriteLine email
outfile.WriteLine sj
outfile.WriteLine hideip
outfile.WriteLine ip
outfile.WriteLine from
outfile.WriteLine homename
outfile.WriteLine url
if counter>3289 then
countline=3289
lyym=1
for i=1 to countline
outfile.WriteLine input(i)
next
else
for i=1 to counter-1
outfile.WriteLine input(i)
next
end if
outfile.close
countfile = server.mappath("speakcount.txt")
set thisfile = fs.OpenTextFile(countfile,1,False)
addcount = thisfile.readline + 1
thisfile.Close
Set outfile = fs.CreateTextFile(countfile)
outfile.WriteLine addcount
outfile.Close
newjs=4
if lyym=1 then
 for i=1 to 3289 step 11
  Redim Preserve new_index(newjs),new_index(newjs+1),new_index(newjs+2)
  new_index(newjs)=input(i)
  new_index(newjs+1)=input(i+1)
  new_index(newjs+2)=input(i+3)
  newjs=newjs+3
 next
else
 for i=1 to counter-1 step 11
  Redim Preserve new_index(newjs),new_index(newjs+1),new_index(newjs+2)
  new_index(newjs)=input(i)
  new_index(newjs+1)=input(i+1)
  new_index(newjs+2)=input(i+3)
  newjs=newjs+3
 next
end if
Application.Lock
Application("a_c_ly_index")=new_index
Application("a_c_ly_num")=UBound(new_index)
Application.Unlock
Response.Redirect "speak.asp?page=1"
Response.end%>

⌨️ 快捷键说明

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