<!-- #include file="Conn.asp" -->
<%
if IsNumeric(Request.Cookies("UserID")) then
sql="select * from [BBSXP_Users] where ID="&Request.Cookies("UserID")&""
Set Rs=Conn.Execute(SQL)
if Rs.eof then
CleanCookies()
Response.Write "<script>window.setTimeout('window.location.reload();',2000)</script>"
Response.End
end if
if Request.Cookies("Userpass") <> Rs("Userpass") then
CleanCookies()
Response.Write "<script>window.setTimeout('window.location.reload();',2000)</script>"
Response.End
end if
CookieUserName=Rs("UserName")
rs.close
end if
Function CleanCookies()
DomainPath=Left(Request.ServerVariables("script_name"),inStrRev(Request.ServerVariables("script_name"),"/"))
For Each objCookie In Request.Cookies
Response.Cookies(objCookie)= ""
Response.Cookies(objCookie).Path = DomainPath
Next
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
UserMoney=Conn.Execute("Select UserMoney From [BBSXP_Users] where username='"&CookieUserName&"'")(0)
if request.Form("menu")="loading" then
	response.Write("&money="&UserMoney&"&"&"user="&CookieUserName)
else
	ary_ico=Array(0,1,6,4,7,2,5,1,0,3,2,4,0,1,6,3,0,5,2,1,0,4,2,3)'动物排列
	ary_userSelect=Array(0,1,2,3,4,5,6,7)'可选动物
	ary_rate=Array(2,3,3,5,5,10,10,20)'赔率
	
	ary_money=Split(Request.Form("money"), "^", -1, 1)
	ary_icoSelect=Split(Request.Form("ico"), "^", -1, 1)
	moneyToPlay=0
	For K = 0 To 7
	moneyToPlay=moneyToPlay+int(ary_money(K))
	if moneyToPlay > UserMoney or moneyToPlay < 0 then Response.End
	Next
	
	Randomize
	winNum=int(rnd*24)
	winMoney=ary_money(ary_ico(winNum))*(ary_rate(ary_ico(winNum))+1)-moneyToPlay
	UserMoney=UserMoney+int(winMoney)
	conn.execute("update [BBSXP_Users] set [UserMoney]="&UserMoney&" where username='"&CookieUserName&"'")
	
	Response.Write("&winNum="&winNum&"&userMoney="&UserMoney)
end if
%>