要是搞不定,我就要失业了,帮帮我,更新不了
这个从表单过来更新数据库失败是不是有错误,大家帮我看看
rs("mobile")=mobile
rs("age")=age有的话,就提示那一样有错误,我注释掉,就提交成功,但数据库里,由<NULL>变成空值
我不知道错误在哪,帮帮我
<!--#include file="../conn.asp"-->
<%
'为防止恶意留言,替换<与> 为 <与>
%>
<%
Function chkstr(str)
str = replace(str, "<", "<", 1, -1, 1)
str = replace(str, ">", ">", 1, -1, 1)
chkstr= str
End Function
dim realname,mobile,tel,tjr,mail,qq,MSN,area,sex,ability,way,money,age,how,ip,rs,sql,regname
realname=trim(request.Form("realname"))
mobile=trim(request.Form("mobile"))
tel=trim(request.Form("tel"))
tjr=trim(request.Form("tjr"))
mail=trim(request.Form("mail"))
qq=trim(request.Form("qq"))
MSN=trim(request.Form("MSN"))
area=trim(request.Form("area"))
sex=trim(request.Form("sex"))
ability=trim(request.Form("ability"))
way=trim(request.Form("way"))
money=trim(request.Form("money"))
age=trim(request.Form("age"))
how=trim(request.Form("how"))
if realname="" then
response.Write"<script lanaguage='javascript'>{window.alert('请填写您的真名!');history.go(-1)}</script>"
end if
if Len(mobile)<10 then
response.Write"<script lanaguage='javascript'>{window.alert('请填写您完整的手机号码!');history.go(-1)}</script>"
end if
if sex="0" then
response.Write"<script lanaguage='javascript'>{window.alert('请选择您的性别!');history.go(-1)}</script>"
end if
if Len(way)<15 then
response.Write"<script lanaguage='javascript'>{window.alert('请选择您参与过的投资方式!');history.go(-1)}</script>"
end if
if Len(ability)<15 then
response.Write"<script lanaguage='javascript'>{window.alert('请选择您参与投资的赢利能力!');history.go(-1)}</script>"
end if
if Len(money)<15 then
response.Write"<script lanaguage='javascript'>{window.alert('请选择您的资金量!');history.go(-1)}</script>"
end if
if area="0" then
response.Write"<script lanaguage='javascript'>{window.alert('请选择您所在的地区!');history.go(-1)}</script>"
end if
if how="0" then
response.Write"<script lanaguage='javascript'>{window.alert('请选择您知道本站的途径!');history.go(-1)}</script>"
end if
if age="0" then
response.Write"<script lanaguage='javascript'>{window.alert('必须选择您的年龄!');history.go(-1)}</script>"
end if
'判断qq号是否合法
if qq<>"" then
if not IsNumeric(qq) or len(qq)<5 or len(qq)>11 then
response.Write"<script language='javascript'>{window.alert('QQ号必须是5-11位的数字!你不会不知道吧?!');history.go(-1)}</script>"
end if
end if
'ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
'if ip = "" Then
'ip = Request.ServerVariables("REMOTE_ADDR")
'end if
'sql="select realname,mobile,tel,tjr,mail,qq,MSN,area,sex,ability,way,money,age,how from guest where regname="®name
regname=session("regname")
Set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from guest where regname='"®name&"'"
rs.open sql,conn,3,3
rs("realname")=realname
'rs("mobile")=mobile
rs("tel")=tel
rs("tjr")= tjr
rs("mail")=mail
rs("qq")=qq
rs("MSN")=MSN
rs("area")=area
rs("sex")=sex
rs("ability")=ability
rs("way")=way
rs("money")=money
'rs("age")=age
rs("how")=how
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Write("<hr><center>更改密码成功!</h2><br><br><br>")
%>