<!--#include file=CONN.ASP-->
<!--#include file=config.asp-->
<!--#include file=usercookies.asp-->
<%
dim rs,sql,username,b,hb,hb_all
b=trim(request("b"))
if request("b")="" then
response.write "<li>参数错误！"
response.write "<meta http-equiv=refresh content=""1;URL=gmdj.asp"">"
response.end
end if
username=request.cookies("fox")("username")
hb_all=b*gghjf
set rs=server.createobject("adodb.recordset")
sql = "select dxb,b from [FOX_user] where username='"&username&"'"
rs.open sql,conn,1,3
if rs("dxb")<int(request("hb")) then
response.write "<li>你的虚拟货币太少，无法购买这么多道具！"
response.write "<meta http-equiv=refresh content=""1;URL=gmdj.asp"">"
response.end
else
rs("dxb")=int(rs("dxb")-hb_all)
rs("b")=rs("b")+int(b)
rs.update
end if
response.write "<li>购买道具成功！"
response.write "<meta http-equiv=refresh content=""1;URL=userhome.asp"">"
rs.close
set rs=nothing
closedb
%>