📄 sellmilk.asp
字号:
<!--#include file="../inc/conn2.asp"-->
<%
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Response.Write("对不起,您不是社区用户,请先注册!")
Response.End
end if%>
<%
sheepname=request.form("sheepname")
milk=request.form("milk")
if sheepname="" or not isnumeric(milk) then
conn.Close
set conn=nothing%>
<script language="vbscript">
msgbox"输入发生错误!!",0,"flush"
history.back
</script>
<%
else
intmilk=milk-int(milk)
if intmilk<>0 or milk<1 then
conn.Close
set conn=nothing%>
<script language="vbscript">
msgbox"发生错误!!",0,"flush"
history.back
</script>
<%else
sql="select * from [sheep] where NC='"&Request.Cookies("NC")&"' and sheepname='"&sheepname&"'"
set rs=conn.Execute(sql)
if rs.eof then
rs.close
set rs=nothing
conn.close
set conn=nothing%>
<script language="vbscript">
msgbox"发生错误!!",0,"flush"
history.back
</script>
<%else
milklast=rs("milk")-milk
if milklast<0 then
rs.close
set rs=nothing
conn.close
set conn=nothing%>
<script language="vbscript">
msgbox"发生错误!!",0,"flush"
history.back
</script>
<%else
rs.close
set rs=nothing
sql="update [sheep] set milk='"&milklast&"' where NC='"&Request.Cookies("NC")&"' and sheepname='"&sheepname&"'"
conn.Execute(sql)
sql="select * from [rules]"
set rs=conn.Execute(sql)
milkprice=rs("milkprice")
rs.close
set rs=nothing
tempsplosh=(milkprice-30)*milk
sql="update HY set JQ=JQ+'"&tempsplosh&"' where NC='"&Request.Cookies("NC")&"'"
conn.Execute(sql)
conn.close
set conn=nothing
%>
<script language="Vbscript">
msgbox"恭喜! 您已经成功卖出宠物,共获得金钱:<%=tempsplosh%>元",0,"提示"
history.back
</script>
<%
end if
end if
end if
end if
%><body background="siba.gif">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -