<!-- #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)
money=int(Request.Form("money"))
if money > UserMoney or money < 0 then Response.End

if request.Form("menu")="loading" then
	response.Write("&money="&UserMoney&"&"&"user="&CookieUserName)
else
	selectNum=int(Request.Form("select"))
	Randomize
	winNum=int(rnd*8)+1 
	if selectNum=winNum then
	  winMoney=money * 7
	  else
	  winMoney=-money
	end if
	
	UserMoney=UserMoney+int(winMoney)
	conn.execute("update [BBSXP_Users] set [UserMoney]="&UserMoney&" where username='"&CookieUserName&"'")
	
	Response.Write("&winNum="&winNum&"&userMoney="&UserMoney)
end if
%>