请问为什么运行此页ok后部分数据却没有被修改成功?很急!在线等待!

MMXMJ 2002-05-13 09:52:52
<%Response.Expires=0
Response.Buffer=true
sjjh_id=Session("sjjh_id")
sjjh_name=Session("sjjh_name")
sjjh_grade=Session("sjjh_grade")
sjjh_jhdj=Session("sjjh_jhdj")
if sjjh_name="" then Response.Redirect "../error.asp?id=440"
if session("sjjh_adminok")<>true then Response.Redirect "../chat/readonly/bomb.htm"
if sjjh_grade<>10 or instr(Application("sjjh_admin"),sjjh_name)=0 then Response.Redirect "../error.asp?id=439"
userid=Request.Form("id")
Response.Write "<body text='#000000' background='../jhimg/bk_hc3w.gif' link='#0000FF' vlink='#0000FF' alink='#0000FF'>"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rst=Server.CreateObject("ADODB.RecordSet")
conn.open Application("sjjh_usermdb")
sqlstr="SELECT * FROM 用户 where id="&userid
rst.Open sqlstr,conn,1,2
if Request.Form("submit")="新增" then rst.AddNew
if Request.Form("submit")="删除" then
sqlstr="delete * from 用户 where id="&userid
conn.Execute sqlstr
Response.Write "成功删除id="&userid&"的用户"
else
hy=0
for i=1 to rst.Fields.Count-1
if Request.Form(i+1)="" then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]的数据不能为空!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).type=11 and lcase(Request.Form(i+1))<>"true" and lcase(Request.Form(i+1))<>"false" then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]为逻辑型如:True或False!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).type=3 and (not isnumeric(Request.Form(i+1))) then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]请使用数字输入!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).type=135 and (not isdate(Request.Form(i+1))) then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]日期数据类型不正确!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.fields(i).Type=202 then strtype="字符"
if rst.fields(i).Type=3 then strtype="数字"
if rst.fields(i).Type=135 then strtype="日期"
if rst.fields(i).Type=11 then strtype="逻辑"

if rst.Fields(i).Name="会员等级" then hy=clng(Request.Form(i+1))
if rst.Fields(i).Name="会员日期" and hy>0 then
if DateDiff("d",date(),cdate(Request.Form(i+1)))<10 then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]会员日期不正确!当设\n置会员等级时,会员日期应大于10天!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if
if rst.Fields(i).Name="门派" then mp=cstr(Request.Form(i+1))
if rst.Fields(i).Name="身份" then sf=cstr(Request.Form(i+1))
if lcase(rst.Fields(i).Name)="grade" then dj=clng(Request.Form(i+1))
if dj<>0 then
if mp="官府" and dj<6 then
Response.Write "<script Language=Javascript>alert('提示:当门派为官府时,[管理级]应大于6!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if mp<>"官府" and dj>=6 then
Response.Write "<script Language=Javascript>alert('提示:当门派不为官府时,[管理级]应小于6!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="掌门" and mp<>"官府" and dj<>5 then
Response.Write "<script Language=Javascript>alert('提示:[身份]掌门的管理等级为5级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="长老" and mp<>"官府" and dj<>4 then
Response.Write "<script Language=Javascript>alert('提示:[身份]长老的管理等级为4级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="护法" and mp<>"官府" and dj<>3 then
Response.Write "<script Language=Javascript>alert('提示:[身份]护法的管理等级为3级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="堂主" and mp<>"官府" and dj<>2 then
Response.Write "<script Language=Javascript>alert('提示:[身份]堂主的管理等级为2级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if
if rst.Fields(i).Name="论谈身份" and Request.Form(i+1)<>"/" and Request.Form(i+1)<>"版主" and Request.Form(i+1)<>"站长" then
Response.Write "<script Language=Javascript>alert('提示:[论谈身份]只能为:/ 版主 站长,/表示由发贴数定!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).Name="银两" then yin=clng(Request.Form(i+1))
if rst.Fields(i).Name="存款" then
yin=yin+clng(Request.Form(i+1))
if yin>2000000000 then
Response.Write "<script Language=Javascript>alert('提示:[银两、存款]总合不可以超过20亿!!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if


Response.Write "<font size=-1>"&rst.Fields(i).Name&"(<font color=blue>"&strtype&"</font>):"&rst.Fields(i).Value&"---->"&Request.Form(i+1)&"<font color=blue>(……资料正确!)</font></font><br><br>"
if rst.Fields(i).type=202 then
rst.Fields(i).Value=cstr(Request.Form(i+1))
elseif rst.Fields(i).type=3 then
rst.Fields(i).Value=clng(Request.Form(i+1))
elseif rst.Fields(i).Type=7 then
rst.Fields(i).Value=cdate(Request.Form(i+1))
end if
next
rst.Update
end if
conn.execute "insert into l(a,b,c,d,e) values (now(),'"& sjjh_name &"','"& Request.ServerVariables("REMOTE_ADDR") &"','管理记录','["&Request.Form("submit")&"]ID="&userid&"的记录!')"
rst.Close
set rst=nothing
conn.Close
set conn=nothing
%>
恭喜,用户资料修改完成!
<a href="fine.asp">返回</a>
...全文
6 点赞 收藏 15
写回复
15 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
popcode 2002-05-13
我没有QQ的,看短消息吧
回复
MMXMJ 2002-05-13
好吧,我的oicq是4941410 你的呢?
回复
popcode 2002-05-13
干脆我把那个几个文件给你下载好了,我是作者送给我的版本的。
回复
MMXMJ 2002-05-13
不行 这样覆盖过去覆盖过来不是办法哦
得想想办法了。。
回复
popcode 2002-05-13
下面这段覆盖了showuser.asp看看
<%Response.Expires=0
Response.Buffer=true
sjjh_id=Session("sjjh_id")
sjjh_name=Session("sjjh_name")
sjjh_grade=Session("sjjh_grade")
sjjh_jhdj=Session("sjjh_jhdj")
if sjjh_name="" then Response.Redirect "../error.asp?id=440"
if session("sjjh_adminok")<>true then Response.Redirect "../chat/readonly/bomb.htm"
if sjjh_grade<>10 or instr(Application("sjjh_admin"),sjjh_name)=0 then Response.Redirect "../error.asp?id=439"
username=Request.Form("search")
cz=Request.form("sjcz")
name=request.querystring("username")
if name<>"" then
username=name
cz="姓名"
end if
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("sjjh_usermdb")
if cz="ID" then
username=int(username)
sqlstr="SELECT * FROM 用户 where "&cz&"="&username
rs.Open sqlstr,conn
else
sqlstr="SELECT * FROM 用户 where "&cz&"='"&username&"'"
rs.Open sqlstr,conn
end if
if rs.EOF or rs.BOF then
Response.Write "<script language=javascript>alert('抱歉你所要查找的人我们找不到!请查看是否正确!');history.back();</script>"
else
if rs("grade")=10 and sjjh_name<>Application("sjjh_user") then
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Write "<script Language=Javascript>alert('提示:不可以修改站长资料!');location.href = 'javascript:history.go(-1)';</script>"
response.end
end if

conn.execute "insert into l(a,b,c,d,e) values (now(),'"& sjjh_name &"','"& Request.ServerVariables("REMOTE_ADDR") &"','管理记录','查找:["&cz&"]="&username&"的记录!')"
Response.Write "<body text='#000000' background='../jhimg/bk_hc3w.gif' link='#0000FF' vlink='#0000FF' alink='#0000FF'>"
Response.Write "<form method=post action=updateuser.asp><table border='1' cellspacing='0' cellpadding='5' height='20' align='center' bordercolorlight='#000000' bordercolordark='#FFFFFF' bgcolor='#FF9900' bordercolor='#FF0000'><tr><td colspan='6'><div align='center'>江湖ID:"&rs("id")&"<input type=hidden readonly size=4 name=id value="&rs("id")&">(<font color=blue size=-1>注意:数据类型与所对应的数据必需相同,否则出错!不能有空的数据存在!</font>)</div></td></tr>"
Response.Write "<tr>"
for i=1 to rs.Fields.Count-1
strtype=rs.fields(i).Type
strname=rs.Fields(i).Name
if rs.fields(i).Type=202 then strtype="字符"
if rs.fields(i).Type=3 then strtype="数字"
if rs.fields(i).Type=7 then strtype="日期"
if rs.fields(i).Type=11 then strtype="逻辑"

if strname="grade" then strname="管理等级"
if strname="mvalue" then strname="月积分"
if strname="allvalue" then strname="总积分"
if strname="times" then strname="登录次数"
if strname="regip" then strname="注册ip"
if strname="lastip" then strname="最后ip"
if strname="regtime" then strname="注册时间"
if strname="lasttime" then strname="最后时间"
Response.Write "<td bgcolor='#FF9900' onmouseout="&chr(34)&"this.bgColor='#FF9900';"&chr(34)&" onmouseover="&chr(34)&"this.bgColor='#8B851C';"&chr(34)&"><div align='right'><font size=-1>"&strname&"(<font color=blue size=-2>"&strtype&"</font>):<input type=text size='10' name="&rs.Fields(i).Name&" value='"&rs.Fields(i).value&"'></font></div></td>"
if i/3=int(i/3) then Response.Write "</tr><tr>"
next
Response.Write "</tr>"
Response.Write "<tr><td colspan='6'><div align='center'><input type=submit value=更新 name=submit> <input type=submit value=新增 name=submit> <input type=submit value=删除 name=submit> <input type=reset value=重置></div></td></tr>"
Response.Write "</table></form>"
end if
rs.Close
set rs=nothing
conn.Close
set conn=nothing
%>
回复
MMXMJ 2002-05-13
没提示错误,我这个除了不能改变除了银两外的数据外其他都是正确的
回复
popcode 2002-05-13
没有提示错误?就是不能update吗?
我用这个是可以用的
回复
MMXMJ 2002-05-13
不对啊。。还不能结贴哦
回复
popcode 2002-05-13
试好了吗?不结贴?
回复
popcode 2002-05-13
试好了吗?不结贴?
回复
MMXMJ 2002-05-13
不对。。那是判断站长身份的。。
回复
MMXMJ 2002-05-13
哦,好的,我看看,谢谢:)
回复
wuya0531 2002-05-13
session("sjjh_adminok")好象没有定义
回复
popcode 2002-05-13
<%Response.Expires=0
Response.Buffer=true
sjjh_id=Session("sjjh_id")
sjjh_name=Session("sjjh_name")
sjjh_grade=Session("sjjh_grade")
sjjh_jhdj=Session("sjjh_jhdj")
if sjjh_name="" then Response.Redirect "../error.asp?id=440"
if session("sjjh_adminok")<>true then Response.Redirect "../chat/readonly/bomb.htm"
if sjjh_grade<>10 or instr(Application("sjjh_admin"),sjjh_name)=0 then Response.Redirect "../error.asp?id=439"
userid=Request.Form("id")
Response.Write "<body text='#000000' background='../jhimg/bk_hc3w.gif' link='#0000FF' vlink='#0000FF' alink='#0000FF'>"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("sjjh_usermdb")
sqlstr="SELECT * FROM 用户 where id="&userid
rs.Open sqlstr,conn,1,2
if Request.Form("submit")="新增" then rs.AddNew
if Request.Form("submit")="删除" then
sqlstr="delete * from 用户 where id="&userid
conn.Execute sqlstr
Response.Write "成功删除id="&userid&"的用户"
else
hy=0
for i=1 to rs.Fields.Count-1
if Request.Form(i+1)="" then
Response.Write "<script Language=Javascript>alert('提示:["&rs.Fields(i).Name&"]的数据不能为空!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rs.Fields(i).type=11 and lcase(Request.Form(i+1))<>"true" and lcase(Request.Form(i+1))<>"false" then
Response.Write "<script Language=Javascript>alert('提示:["&rs.Fields(i).Name&"]为逻辑型如:True或False!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rs.Fields(i).type=3 and (not isnumeric(Request.Form(i+1))) then
Response.Write "<script Language=Javascript>alert('提示:["&rs.Fields(i).Name&"]请使用数字输入!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rs.Fields(i).type=135 and (not isdate(Request.Form(i+1))) then
Response.Write "<script Language=Javascript>alert('提示:["&rs.Fields(i).Name&"]日期数据类型不正确!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rs.fields(i).Type=202 then strtype="字符"
if rs.fields(i).Type=3 then strtype="数字"
if rs.fields(i).Type=135 then strtype="日期"
if rs.fields(i).Type=11 then strtype="逻辑"

if rs.Fields(i).Name="会员等级" then hy=clng(Request.Form(i+1))
if rs.Fields(i).Name="会员日期" and hy>0 then
if DateDiff("d",date(),cdate(Request.Form(i+1)))<10 then
Response.Write "<script Language=Javascript>alert('提示:["&rs.Fields(i).Name&"]会员日期不正确!当设\n置会员等级时,会员日期应大于10天!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if
if rs.Fields(i).Name="门派" then mp=cstr(Request.Form(i+1))
if rs.Fields(i).Name="身份" then sf=cstr(Request.Form(i+1))
if lcase(rs.Fields(i).Name)="grade" then dj=clng(Request.Form(i+1))
if dj<>0 then
if mp="官府" and dj<6 then
Response.Write "<script Language=Javascript>alert('提示:当门派为官府时,[管理级]应大于6!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if mp<>"官府" and dj>=6 then
Response.Write "<script Language=Javascript>alert('提示:当门派不为官府时,[管理级]应小于6!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="掌门" and mp<>"官府" and dj<>5 then
Response.Write "<script Language=Javascript>alert('提示:[身份]掌门的管理等级为5级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="长老" and mp<>"官府" and dj<>4 then
Response.Write "<script Language=Javascript>alert('提示:[身份]长老的管理等级为4级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="护法" and mp<>"官府" and dj<>3 then
Response.Write "<script Language=Javascript>alert('提示:[身份]护法的管理等级为3级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="堂主" and mp<>"官府" and dj<>2 then
Response.Write "<script Language=Javascript>alert('提示:[身份]堂主的管理等级为2级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if
if rs.Fields(i).Name="论谈身份" and Request.Form(i+1)<>"/" and Request.Form(i+1)<>"版主" and Request.Form(i+1)<>"站长" then
Response.Write "<script Language=Javascript>alert('提示:[论谈身份]只能为:/ 版主 站长,/表示由发贴数定!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rs.Fields(i).Name="银两" then yin=clng(Request.Form(i+1))
if rs.Fields(i).Name="存款" then
yin=yin+clng(Request.Form(i+1))
if yin>2000000000 then
Response.Write "<script Language=Javascript>alert('提示:[银两、存款]总合不可以超过20亿!!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if


Response.Write "<font size=-1>"&rs.Fields(i).Name&"(<font color=blue>"&strtype&"</font>):"&rs.Fields(i).Value&"---->"&Request.Form(i+1)&"<font color=blue>(……资料正确!)</font></font><br><br>"
if rs.Fields(i).type=202 then
rs.Fields(i).Value=cstr(Request.Form(i+1))
elseif rs.Fields(i).type=3 then
rs.Fields(i).Value=clng(Request.Form(i+1))
elseif rs.Fields(i).Type=7 then
rs.Fields(i).Value=cdate(Request.Form(i+1))
end if
next
rs.Update
end if
conn.execute "insert into l(a,b,c,d,e) values (now(),'"& sjjh_name &"','"& Request.ServerVariables("REMOTE_ADDR") &"','管理记录','["&Request.Form("submit")&"]ID="&userid&"的记录!')"
rs.Close
set rs=nothing
conn.Close
set conn=nothing
%>
恭喜,用户资料修改完成!
<a href="fine.asp">返回</a>
回复
wuya0531 2002-05-13
哪个数据没有修改成功?代码好长
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2002-05-13 09:52
社区公告
暂无公告