飞
飞云.net
Unregistered / Unconfirmed
GUEST, unregistred user!
帮我看看老出500错误,我估记以面*号包住的那一部份有问题。
<!-- #include file="data.asp" -->
<%
'#################################数据获得和检验模块##########################
username=Trim(Request("username"))
if username="" then
Response.Redirect "error.asp?id=001"
password=Trim(Request("password"))
If password="" then
Response.Redirect "error.asp?id=002"
rpassword=Trim(Request("rpassword"))
if password<>rpassword then
Response.Redirect"error.asp?id=003"
if username=password then
Response.Redirect "error.asp?id=004"
email=Trim(Request("email"))
if email="" or instr(email,"@")=0 then
Response.Redirect"error.asp?id=005"
hompage=Trim(Request("homepage"))
zname=Trim(Request("zname"))
sex=Trim(Request("sex"))
if sex="" then
Response.Redirect"error.asp?id=006"
birthdayyear=Trim(Request("birthdayyear"))
birthdaymonth=Trim(Request("birthdaymonth"))
birthdayday=Trim(Request("birthdayday"))
if birthdayyear="" or birthdaymonth="" or birthdayday="" then
Response.Redirect "error.asp?id=007 "
else
birthday=birthdayyear &
"-" &birthdaymonth&
"-" &birthdayday
end if
blood=Trim(Request("blood"))
province=Trim(Request("province"))
if province="" then
Response.Redirect "error.asp?id=008"
add=Trim(Request("add"))
phone=Trim(Request("phone"))
bp=Trim(Request("bp"))
sms=Trim(Request("sms"))
oicq=Trim(Request("oicq"))
smn=Trim(Request("smn"))
fond=Trim(Request("fond"))
if fond="" then
Response.Redirect"error.asp?id=009"
tj=Trim(Request("tj"))
friendview=Trim(Request("friendview"))
jianli=Trim(Request("jianli"))
if jianli="" then
Response.Redirect"error.asp?id=010"
Function cnlen(zhc)
namelen=0
for i=1 to len(zhc)
zhasc=asc(mid(zhc,i,1))
if zhasc<0 then
namelen=namelen+2
else
namelen=namelen+1
end if
cnlen=namelen
next
End Function
if cnlen(username)>12 then
Response.Redirect "error.asp?id=011"
if cnlen(password)<4 or cnlen(password)>20 then
Response.Redirect "error.asp?id=012"
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len=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
regdate=n &
"-" &
y &
"-" &
r &
" " &
s &
":" &
f &
":" &
m
userip=Request.ServerVariables("REMOTE_ADDR")
Function CheckInput(strSQL)
'If strSQL = "" then
strSQL = " "
strSQL= Replace(strSQL, "'", "''")
CheckInput=strSQL
End Function
'#####################以下是数据库操作模块################
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open connstr
set rs=conn.Execute("select*from member where username='"&username&"'")
If (rs.EOF and rs.BOF) then
*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
strSQL="INSERT INTO member (username,password,email,homepage,zname,sex,birthday,blood,province,add,phone,bp,sms,oicq,snm,fond,tj,friendview,regip,endip,regdate,jianli) VALUES ("&CheckInput(username)&","&CheckInput(password)&","&CheckInput(email)&","&CheckInput(homepage)&","&CheckInput(zname)&","&CheckInput(sex)&","&checkinput(birthday)&","&CheckInput(blood)&","&CheckInput(province)&","&CheckInput(add)&","&CheckInput(phone)&","&CheckInput(bp)&","&CheckInput(sms)&","&CheckInput(oicq)&","&CheckInput(snm)&","&CheckInput(fond)&","&CheckInput(tj)&","&CheckInput(friendview)&","&CheckInput(userip)&","&CheckInput(userip)&","&CheckInput(regdate)&","&CheckInput(jianli)&")" *
conn.Execute(strSQL)*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
rs.close
conn.close
set rs=nothing
set conn=nothing
else
Response.Redirect "error.asp?id=013"
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
%>
<!-- #include file="data.asp" -->
<%
'#################################数据获得和检验模块##########################
username=Trim(Request("username"))
if username="" then
Response.Redirect "error.asp?id=001"
password=Trim(Request("password"))
If password="" then
Response.Redirect "error.asp?id=002"
rpassword=Trim(Request("rpassword"))
if password<>rpassword then
Response.Redirect"error.asp?id=003"
if username=password then
Response.Redirect "error.asp?id=004"
email=Trim(Request("email"))
if email="" or instr(email,"@")=0 then
Response.Redirect"error.asp?id=005"
hompage=Trim(Request("homepage"))
zname=Trim(Request("zname"))
sex=Trim(Request("sex"))
if sex="" then
Response.Redirect"error.asp?id=006"
birthdayyear=Trim(Request("birthdayyear"))
birthdaymonth=Trim(Request("birthdaymonth"))
birthdayday=Trim(Request("birthdayday"))
if birthdayyear="" or birthdaymonth="" or birthdayday="" then
Response.Redirect "error.asp?id=007 "
else
birthday=birthdayyear &
"-" &birthdaymonth&
"-" &birthdayday
end if
blood=Trim(Request("blood"))
province=Trim(Request("province"))
if province="" then
Response.Redirect "error.asp?id=008"
add=Trim(Request("add"))
phone=Trim(Request("phone"))
bp=Trim(Request("bp"))
sms=Trim(Request("sms"))
oicq=Trim(Request("oicq"))
smn=Trim(Request("smn"))
fond=Trim(Request("fond"))
if fond="" then
Response.Redirect"error.asp?id=009"
tj=Trim(Request("tj"))
friendview=Trim(Request("friendview"))
jianli=Trim(Request("jianli"))
if jianli="" then
Response.Redirect"error.asp?id=010"
Function cnlen(zhc)
namelen=0
for i=1 to len(zhc)
zhasc=asc(mid(zhc,i,1))
if zhasc<0 then
namelen=namelen+2
else
namelen=namelen+1
end if
cnlen=namelen
next
End Function
if cnlen(username)>12 then
Response.Redirect "error.asp?id=011"
if cnlen(password)<4 or cnlen(password)>20 then
Response.Redirect "error.asp?id=012"
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len=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
regdate=n &
"-" &
y &
"-" &
r &
" " &
s &
":" &
f &
":" &
m
userip=Request.ServerVariables("REMOTE_ADDR")
Function CheckInput(strSQL)
'If strSQL = "" then
strSQL = " "
strSQL= Replace(strSQL, "'", "''")
CheckInput=strSQL
End Function
'#####################以下是数据库操作模块################
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open connstr
set rs=conn.Execute("select*from member where username='"&username&"'")
If (rs.EOF and rs.BOF) then
*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
strSQL="INSERT INTO member (username,password,email,homepage,zname,sex,birthday,blood,province,add,phone,bp,sms,oicq,snm,fond,tj,friendview,regip,endip,regdate,jianli) VALUES ("&CheckInput(username)&","&CheckInput(password)&","&CheckInput(email)&","&CheckInput(homepage)&","&CheckInput(zname)&","&CheckInput(sex)&","&checkinput(birthday)&","&CheckInput(blood)&","&CheckInput(province)&","&CheckInput(add)&","&CheckInput(phone)&","&CheckInput(bp)&","&CheckInput(sms)&","&CheckInput(oicq)&","&CheckInput(snm)&","&CheckInput(fond)&","&CheckInput(tj)&","&CheckInput(friendview)&","&CheckInput(userip)&","&CheckInput(userip)&","&CheckInput(regdate)&","&CheckInput(jianli)&")" *
conn.Execute(strSQL)*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
rs.close
conn.close
set rs=nothing
set conn=nothing
else
Response.Redirect "error.asp?id=013"
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
%>