注册 登录
编程论坛 ASP技术论坛

审核后,刷新又变成未审核了。怎么改?

gege83 发布于 2012-07-23 12:41, 635 次点击
<%
action=request("action")
select case action
case "yc" '审核见证人注册
sql="select * from DB_yy where id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs("xh")=0 then
rs("xh")=1
else
rs("xh")=0
end if
rs.update
rs.close
set rs=Nothing
end select
 %>





<%
 if Rs("xh")=0 then
 shm="<a href='javascript:if(window.confirm(""你确实要取消审核吗?"") == true){window.location =""?action=yc&s="&request.form("sersch")&request("s")&"&Page="&Page&"&id="&rs("id")&""";}'>取消审核</a>"
 else
 shm="<a href='javascript:if(window.confirm(""你确实要审核吗?"") == true){window.location =""?action=yc&s="&request.form("sersch")&request("s")&"&Page="&Page&"&id="&rs("id")&""";}'>审核</a>"
 end if
  %>
 <%= shm %> 
 
 
 
 
我现在不要审核和取消审核直接切换,我现在只要点了审核后,就直接显示已审核,不能再点了,表:DB_YY,字段:xh  (数值,初始值为1,审核后为:0)
2 回复
#2
ysf01812012-07-23 13:47
action=request("action")
select case action
case "yc" '审核见证人注册
sql="select * from DB_yy where id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs("xh")=0 then
rs("xh")=1
else
rs("xh")=0
end if
rs.update
rs.close
set rs=Nothing
end select
你这个代码变来就是刷新就变为两者的一者。。。。。1 或者 0

代码变为:
if rs("xh")=0 then
   rs("xh")=1
end if
具体怎么变,还得看你参数传递限制
在加一个参数,就是可以修改 已审  未审
例如:
if aa = 1 then
    rs("xh")=1
end if
if aa = 0 then
   rs("xh")=0
end if

#3
nhb19792012-08-19 13:49
好帖!
1