home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
221.214.14.186
/
221.214.14.186.tar
/
221.214.14.186
/
zb
/
Notepad-zb
/
rpost_do.asp
< prev
next >
Wrap
Text File
|
2005-12-26
|
6KB
|
270 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 rtid, rs, exec, rs2, rs1, reID, reTime,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"))
male=encodestr(Request.form("male"))
face=encodestr(Request.form("face"))
nei=replace(Request.form("nei"),"'","""")
pic=encodestr(Request.form("pic"))
rtid=encodestr(Request.form("rtid"))
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
response.redirect("error.asp")
end if
if theUser.reged then
name=theUser.name
qq=theUser.qq
icq=theUser.icq
msn=theUser.msn
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)
exec="select * from [user] where username='"&name&"'"
Set RS = Server.CreateObject("ADODB.RecordSet")
rs.Open exec, Conn, 1, 1
if not rs.eof then
if pass=rs("userpassword") then
qq=rs("oicq")
icq=rs("icq")
msn=rs("msn")
email=rs("useremail")
url=rs("homepage")
male=rs("sex")
face=rs("GBface")
rsclose()
bl=1
else
rsclose()
connclose()
session("error")="▒ú┴⌠╙├╗º├▄┬δ╒╩║┼▓╗╢╘╙ªúíúíúí"
response.redirect "error.asp"
end if
else
rsclose()
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 rs = Server.CreateObject("ADODB.Recordset")
exec="select * from [user] where userid=0"
rs.Open exec,conn,1,2
rs.addnew
rs("username")=name
rs("userpassword")=pass
if email<>"" then
rs("useremail")=email
end if
if qq<>"" then
rs("oicq")=qq
end if
if icq<>"" then
rs("icq")=icq
end if
if msn<>"" then
rs("msn")=msn
end if
if url<>"" then
rs("homepage")=url
end if
rs("sex")=male
rs("GBface")=face
rs("GBpostNum")=0
rs("GBprivateNum")=0
rs("AddDate")=dateAdd("h",timeDiff,now)
rs.update
rsclose()
exec="update GBconst set userNum=userNum+1"
conn.execute(exec)
bl=1
end if
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
exec="select top 1 userid from [user] where username='"& name &"'"
set rs=conn.execute(exec)
if not rs.eof then
connclose()
session("error")="─·╩╣╙├╡─╙├╗º├√╩▄╡╜▒ú╗ñ,╟δ╕ⁿ╗╗!"
response.redirect("error.asp")
end if
rs.close
set rs=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
'╕╕╠√╩╟▓╗╩╟╕∙╠√
exec="select rt from ly where id="& rtid
set rs=conn.execute(exec)
if rs.eof then
connclose()
session("error")="─·╥¬╗╪╕┤╡─┴⌠╤╘╥╤▓╗┤µ╘┌!"
response.redirect("error.asp")
else
if rs(0)>0 then
rtid=rs(0)
end if
end if
Set rs = Server.CreateObject("ADODB.Recordset")
exec="select * from ly where id=0"
rs.Open exec,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("retime")=dateAdd("h",timeDiff,now)
rs("pic")=pic
rs("bl")=bl
rs("yd")=0
rs("hf")=0
rs("jh")=0
rs("rt")=rtid
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
exec="select max(id) from ly"
rs.open exec,conn,1,1
reID=rs(0)
rs.close
exec="select top 1 * from ly where id="& Cstr(rtid)
rs.open exec,conn,1,3
if not (rs.eof and rs.bof) then
rs("hf")=rs("hf")+1
rs("reid")=reid
rs("reTime")=dateAdd("h",timeDiff,now)
rs.update
end if
rsclose()
if bl=1 then
exec="update [user] set GBpostNum=GBpostNum+1 where username='"& name &"'"
conn.execute(exec)
end if
connclose()
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="&rtid
response.redirect "addok.asp"
%>