www.gusucode.com > 盐城分类信息网asp源码程序 > com_e_x_d.asp

    <!--#include file="inc/conn.asp"--> 
<!--#include file=usercookies.asp-->
<link href="inc/style.css" rel="stylesheet" type="text/css">
<%
dim user_d,i
i=1
id=trim(request("id"))
username=request.cookies("cnmai")("username")
set rs = Server.CreateObject("ADODB.RecordSet")
if request("cnmai")="chk" then
call edit_d()
response.end
else
sql="select d from [com] where username='"&username&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "参数错误!"
response.end
end if
user_d=rs("d")
if user_d=0 then
response.write "你还没有道具,请先购买道具!"
cl
response.end
end if
rs.close
%>
<body topmargin="0">
<title>信息修改-置顶道具使用</title>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" height="25">
<p align="left">你现在还有<%=user_d%>个<font color="#0000FF">通过验证道具</font></td>
</tr>
<tr>
<form action="?id=<%=id%>&cnmai=chk" method="POST">
<td width="100%" height="25">
<p align="left">如果希望让该信息直接在页面显示请选择是否使用<font color="#0000FF">验证道具</font>:
<%if user_d>0 then%>&nbsp;&nbsp;&nbsp;
<select name="d">
<option selected value="0">不使用</option>
<option value="1">使用</option>
</select>&nbsp;&nbsp;                     
				  <input type="submit" value="提交" name="B1"><%else%>
<font color="#999999">没有道具</font>
<%end if%>
</td>
</form>
</tr>
</table>
<p align="left">此操作将减掉相应的道具数量使用一次需要一个道具</p>
<%
end if
sub edit_d()
sql="select d from [com] where username='"&username&"'"
rs.open sql,conn,1,3
d=rs("d")
if trim(request("d"))="0" then
response.write "你选择了不使用,请进行其他操作!"
cl
response.end
end if
if d=<0 then
response.write "没有足够的道具!"
cl
response.end
else
rs("d")=rs("d")-1
rs.update
end if
rs.close
sql="select yz,fbsj from [xinxi] where username='"&username&"' and id="&cstr(id)
rs.open sql,conn,1,3
rs("yz")=1
rs("fbsj")=now()
rs.update
response.write "使用道具成功,你的信息已经通过了验证!"
rs.close
cl
response.end
end sub
%>
<%sub cl()%>
<body onLoad="setTimeout(window.close, 2000)">
<%end sub%>
<%closedb%>