home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
221.214.14.186
/
221.214.14.186.tar
/
221.214.14.186
/
zb
/
Notepad-1
/
post_do.asp
< prev
next >
Wrap
Text File
|
2004-12-09
|
6KB
|
259 lines
<!--#include file="conn.asp"-->
<!--#include file="connip.asp"-->
<!--#include file=const.asp -->
<!--#include file=md5.asp -->
<%
dim title,name,pass,email,qq,url,pic,nei,t,rt,yd,hf,jh,bl,male,face,icq,msn
dim exec1, rs1, rs, rs2, id,isPrivate, foundErr
title=encodestr(Request.form("title"))
name=encodestr(Request.form("name"))
pass=encodestr(Request.form("pass"))
email=encodestr(Request.form("email"))
qq=encodestr(Request.form("qq"))
icq=encodestr(Request.form("icq"))
msn=encodestr(Request.form("msn"))
url=encodestr(Request.form("url"))
nei=replace(Request.form("nei"),"'","""")
pic=encodestr(Request.form("pic"))
male=encodestr(Request.form("male"))
face=encodestr(Request.form("face"))
isPrivate=encodestr(Request.form("isPrivate"))
bl=0
if isDate(request.cookies("gbook")("lastpost")) then
if dateDiff("s",Cdate(request.cookies("gbook")("lastPost")),now)<=postLimit then
session("error")="╟δ▓╗╥¬╣α╦«úíúí<br>"
foundErr=true
end if
end if
if len(title)<3 then
session("error")="╟δ╚╧╒µ╠ε╨┤┴⌠╤╘▒Ω╠Γúíúí<br>"
foundErr=true
end if
if len(name)=0 and not theUser.reged then
session("error")=session("error") & "╟δ╠ε╨┤╙├╗º├√úíúí<br>"
foundErr=true
end if
if len(nei)<2 then
session("error")=session("error") & "╟δ╚╧╒µ╠ε╨┤┴⌠╤╘─┌╚▌úíúí<br>"
foundErr=true
end if
if len(nei)>maxLength then
session("error")=session("error") & "┴⌠╤╘─┌╚▌╫ε╢α"& maxLength &"╕÷╫╓╖√ú¼╟δ╝⌡╔┘─π╡─┴⌠╤╘─┌╚▌úíúí<br>"
foundErr=true
end if
if len(title)>40 then
session("error")=session("error") & "┴⌠╤╘▒Ω╠Γ▓╗┐╔╥╘│¼╣²40╕÷╫╓╖√úíúí<br>"
foundErr=true
end if
if len(name)>10 then
session("error")=session("error") & "╙├╗º├√▓╗┐╔╥╘│¼╣²10╕÷╫╓╖√úíúí<br>"
foundErr=true
end if
if foundErr then
connclose()
response.redirect("error.asp")
end if
if theUser.reged then
name=theUser.name
qq=theUser.qq
email=theUser.email
url=theUser.url
if theUser.male then
male="1"
else
male="0"
end if
face=theUser.face
bl=1
elseif pass<>"" then
pass=MD5(pass)
exec1="select * from [user] where username='"&name&"'"
Set RS1 = Server.CreateObject("ADODB.RecordSet")
rs1.Open exec1, Conn, 1, 2
if not rs1.eof then
if pass=rs1("userpassword") then
qq=rs1("oicq")
icq=rs1("icq")
msn=rs1("msn")
email=rs1("useremail")
url=rs1("homepage")
male=rs1("sex")
face=rs1("GBface")
bl=1
else
rs1.close : set rs1=nothing
connclose()
session("error")="▒ú┴⌠╙├╗º├▄┬δ╒╩║┼▓╗╢╘╙ªúíúíúí"
response.redirect "error.asp"
end if
else
if email<>"" and not validEmail(email) then
connclose()
session("error")="╟δ╩Σ╚δ╒²╚╖╡─email╡╪╓╖úíúíúí"
response.redirect "error.asp"
end if
if isLikeMasterName(name) then
connclose()
session("error")="╟δ▓╗╥¬╩╣╙├╙δ░µ╓≈├√╧α╦╞╡─╙├╗º├√úíúíúí"
response.redirect "error.asp"
end if
Set rs2 = Server.CreateObject("ADODB.Recordset")
exec1="select * from [user] where userid=0"
rs2.Open exec1,conn,1,2
rs2.addnew
rs2("username")=name
rs2("userpassword")=pass
if email<>"" then
rs2("useremail")=email
end if
if qq<>"" then
rs2("oicq")=qq
end if
if icq<>"" then
rs2("icq")=icq
end if
if msn<>"" then
rs2("msn")=msn
end if
if url<>"" then
rs2("homepage")=url
end if
rs2("sex")=male
rs2("GBface")=face
rs2("GBpostNum")=0
rs2("GBprivateNum")=0
rs2("addDate")=dateAdd("h",timeDiff,now)
rs2.update
rs2.close
set rs2=nothing
exec1="update GBconst set userNum=userNum+1"
conn.execute(exec1)
bl=1
end if
rs1.close
set rs1=nothing
else
'╬┤╫ó▓ß,╬┤╠ε├▄┬δ
if mustReg then
connclose()
session("error")="╓╗╙╨╫ó▓ß╙├╗º┐╔╥╘╖ó╤╘ú¼╟δ╫ó▓ßúí"
response.redirect "error.asp"
end if
if email<>"" and not validEmail(email) then
connclose()
session("error")="╟δ╩Σ╚δ╒²╚╖╡─email╡╪╓╖úíúíúí"
response.redirect "error.asp"
end if
if isLikeMasterName(name) then
connclose()
session("error")="╟δ▓╗╥¬╩╣╙├╙δ░µ╓≈├√╧α╦╞╡─╙├╗º├√úíúíúí"
response.redirect "error.asp"
end if
exec1="select top 1 userid from [user] where username='"& name &"'"
set rs2=conn.execute(exec1)
if not rs2.eof then
connclose()
session("error")="─·╩╣╙├╡─╙├╗º├√╩▄╡╜▒ú╗ñ,╟δ╕ⁿ╗╗!"
response.redirect("error.asp")
end if
rs2.close
set rs2=nothing
if request.cookies("gbookGuestName")<>"" then
if name<>request.cookies("gbookGuestName") then
connclose()
session("error")="╟δ▓╗╥¬╩╣╙├╢α╕÷╙├╗º├√┴⌠╤╘"
response.redirect "error.asp"
end if
else
if cookiePath<>"" then
response.cookies("gbookGuestName").Path=cookiePath
end if
response.cookies("gbookGuestName")=name
end if
end if
Set rs = Server.CreateObject("ADODB.Recordset")
exec1="select * from ly where id=0"
rs.Open exec1,conn,1,2
rs.addnew
rs("name")=name
rs("title")=title
if email<>"" then
rs("email")=email
end if
if qq<>"" then
rs("qq")=qq
end if
if icq<>"" then
rs("icq")=icq
end if
if msn<>"" then
rs("msn")=msn
end if
if url<>"" then
rs("url")=url
end if
rs("male")=male
rs("face")=face
rs("nei")=nei
rs("t")=dateAdd("h",timeDiff,now)
rs("pic")=pic
rs("bl")=bl
rs("yd")=0
rs("hf")=0
rs("jh")=0
rs("rt")=0
rs("ip")=request.servervariables("remote_addr")
rs("comefrom")=getFrom(request.servervariables("remote_addr"))
if isPrivate="1" then
rs("isPrivate")=1
end if
rs.update
rs.close
exec1="select max(id) from ly"
rs.open exec1,conn,1,1
id=rs(0)
rs.close
set rs=nothing
exec1="update ly set reid=id, retime=t where id="& id
conn.execute exec1
exec1="update GBconst set topicNum=topicNum+1"
conn.execute(exec1)
if bl=1 then
exec1="update [user] set GBpostNum=GBpostNum+1 where username='"& name &"'"
conn.execute(exec1)
end if
if bl=1 and isPrivate="1" then
exec1="update GBconst set privateNum=privateNum+1"
conn.execute(exec1)
exec1="update [user] set GBprivateNum=GBprivateNum+1 where username='"& name &"' "
conn.execute(exec1)
end if
conn.close
set conn=nothing
connIpclose()
if cookiePath<>"" then
response.cookies("gbook").Path=cookiePath
end if
response.cookies("gbook")("lastPost")=now
if not theUser.reged then
response.cookies("gbook")("username")=vbescape(name)
response.cookies("gbook")("password")=pass
end if
session("url")="show.asp?id="&id
response.redirect "addok.asp"
%>