帮我看看老出500错误,我估记以面*号包住的那一部份有问题。 (100分)

  • 主题发起人 飞云.net
  • 开始时间

飞云.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 &amp;
"-" &amp;birthdaymonth&amp;
"-" &amp;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(y)=1 then
y="0" &amp;
y
if len(r)=1 then
r="0" &amp;
r
if len(s)=1 then
s="0" &amp;
s
if len(f)=1 then
f="0" &amp;
f
if len(m)=1 then
m="0" &amp;
m
regdate=n &amp;
"-" &amp;
y &amp;
"-" &amp;
r &amp;
" " &amp;
s &amp;
":" &amp;
f &amp;
":" &amp;
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='"&amp;username&amp;"'")
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 ("&amp;CheckInput(username)&amp;","&amp;CheckInput(password)&amp;","&amp;CheckInput(email)&amp;","&amp;CheckInput(homepage)&amp;","&amp;CheckInput(zname)&amp;","&amp;CheckInput(sex)&amp;","&amp;checkinput(birthday)&amp;","&amp;CheckInput(blood)&amp;","&amp;CheckInput(province)&amp;","&amp;CheckInput(add)&amp;","&amp;CheckInput(phone)&amp;","&amp;CheckInput(bp)&amp;","&amp;CheckInput(sms)&amp;","&amp;CheckInput(oicq)&amp;","&amp;CheckInput(snm)&amp;","&amp;CheckInput(fond)&amp;","&amp;CheckInput(tj)&amp;","&amp;CheckInput(friendview)&amp;","&amp;CheckInput(userip)&amp;","&amp;CheckInput(userip)&amp;","&amp;CheckInput(regdate)&amp;","&amp;CheckInput(jianli)&amp;")" *
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
%>
 
我把下面的数据操作模块注释起来可以正常执行。
 
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 ('"&amp;CheckInput(username)&amp;"','"&amp;CheckInput(password)&amp;"','"&amp;CheckInput(email)&amp;"','"&amp;CheckInput(homepage)&amp;"','"&amp;CheckInput(zname)&amp;"','"&amp;CheckInput(sex)&amp;"','"&amp;checkinput(birthday)&amp;"','"&amp;CheckInput(blood)&amp;"','"&amp;CheckInput(province)&amp;"','"&amp;CheckInput(add)&amp;"','"&amp;CheckInput(phone)&amp;"','"&amp;CheckInput(bp)&amp;"','"&amp;CheckInput(sms)&amp;"','"&amp;CheckInput(oicq)&amp;"','"&amp;CheckInput(snm)&amp;"','"&amp;CheckInput(fond)&amp;"','"&amp;CheckInput(tj)&amp;"','"&amp;CheckInput(friendview)&amp;"','"&amp;CheckInput(userip)&amp;"','"&amp;CheckInput(userip)&amp;"','"&amp;CheckInput(regdate)&amp;"','"&amp;CheckInput(jianli)&amp;"')"
呵,少了单引号,
 
应该说不需要的,我以前没加单引号都可以执行。
 
这是稻香居士的一个程序中这样写的。
sql="INSERT INTO user (kill,leave,username,pwd,grade,notes,regtime,regip,lasttime,lastip) VALUES ('0','0'," &amp;
SqlStr(username) &amp;
"," &amp;
SqlStr(mmpwd) &amp;
",1,0," &amp;
SqlStr(sj) &amp;
"," &amp;
SqlStr(userip) &amp;
"," &amp;
SqlStr(sj) &amp;
"," &amp;
SqlStr(userip) &amp;
")"
 
刚才试了,还是了出错。
 
麻烦各位,再看看好吗?
 
顶部