match.asp

来自「asp构建网站bbs.采用B/S架构」· ASP 代码 · 共 265 行

ASP
265
字号
<!-- #include file="conn.asp" -->
<%h1="艾基脑"
h2="马虎"
h3="赤马尾"
h4="玛雅侠"
h5="雷电"
h6="蒙面怪客"
h7="NASAKI"
h8="极度凶兽"
%>
<head><title>赌马马场</title>
<META content=text/html; charset=gb2312 http-equiv=Content-Type>
<STYLE>
#Layer0 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 10
}
#Layer1 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 20
}
#Layer2 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 30
}
#Layer3 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 40
}
#Layer4 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 50
}
#Layer5 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 60
}
#Layer6 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 60
}
#Layer7 {
	HEIGHT: 20px; LEFT: -100px; POSITION: absolute; TOP: -100px; WIDTH: 60px; Z-INDEX: 60
}
BODY {
	FONT-SIZE: 9pt; LINE-HEIGHT: 13pt; WORD-SPACING: normal
}
P {
	FONT-SIZE: 9pt; LINE-HEIGHT: 13pt; WORD-SPACING: normal
}
TD {
	FONT-SIZE: 9pt; LINE-HEIGHT: 13pt; WORD-SPACING: normal
}
</STYLE>
<style type="text/css">
select, input{font-size:9pt}
td{height:35;background:#ffffff;color:#ffffff;font-size:14}
</style>
</head>

<%
horseto=0
win=Request.Form("win")
if win="" then%>
<script language="vbscript">
msgbox "对不起,您没有选择马匹!"
location.href = "horse.asp"
</script>
<%else
pledge=Request.Form("pledge")
if not isnumeric(pledge) then%>
<script language="vbscript">
msgbox "请输入数字!"
location.href = "horse.asp"
</script>
<%
elseif int(pledge) - pledge <>0 then
%>
<script language="vbscript">
msgbox "请输入整数!"
location.href = "horse.asp"
</script>
<%
elseif pledge < 10 then
%>
<script language="vbscript">
msgbox "对不起,您的赌注太小,赌注下限是10NG!"
location.href = "horse.asp"
</script>
<%
elseif pledge >999 then
%>
<script language="vbscript">
msgbox "别玩的过火了,赌注上限是999NG!"
location.href = "horse.asp"
</script>
<%
else
dim horse(7)
for i=0 to 7
	horse(i)=Request.Form("horse"&i)
	if i= win-1 then
	horse(i)=pledge 
	else horse(i)=0 
	end if
	for j=1 to len(horse(i))
		tmpasc=asc(mid(horse(i),j,1))
		if tmpasc<48 or tmpasc>57 then
			horse(i)=0
			exit for
		end if
	next
	horseto=horseto+horse(i)
next
horse(win-1)=pledge
if request.cookies(cn)("lgname") ="" then
%>
<script language="vbscript">
msgbox "您怎么跑到这里来的?!"
location.href = "login.asp"
</script>
<%
else
set rst=server.CreateObject ("adodb.recordset")
sqlstr="select * from user where name='"&request.cookies(cn)("lgname")&"' and int(qian)>="&horseto&""
rst.open sqlstr,myconn	
if rst.EOF or rst.BOF then
%>
<script language="vbscript">
msgbox "您的现金不够!"
location.href = "index.asp"
</script>
<%
else
rst.Close
set rst=nothing
sqlstr="update user set qian=qian-"&pledge&" where name='"&request.cookies(cn)("lgname")&"'"
myconn.Execute sqlstr
myconn.Close 
%>
<SCRIPT language=JavaScript> 
xcoor = new Array(10,10,10,10,10,10,10,10);  
ycoor = new Array(60,95,125,160,195,230,265,300,335);
function doplay()
{
    var x
    for(j=0;j<8;j++){
    	x=Math.floor(10*Math.random());
    	xcoor[j] = xcoor[j] + x;
    	if ( xcoor[j] >= 600) {
			document.form1.horsewin.value=j;
			document.form1.prize.value='<%=horse(j)%>';
			setTimeout('document.form1.submit()',1500);  
			return;
    	}
        eval('document.all'+'["Layer'+j+'"]'+'.style.left='+xcoor[j]);
		eval('document.all'+'["Layer'+j+'"]'+'.style.top='+ycoor[j]);
  	}
    setTimeout('doplay()',100);  
}
</SCRIPT>
<body onload=doplay() bgcolor=#FFFFFF>
<DIV id=Layer0><DD><IMG  src=horse_img/h1.gif > </DD></DIV>
<DIV id=Layer1><DD><IMG  src=horse_img/h2.gif > </DD></DIV>
<DIV id=Layer2><DD><IMG  src=horse_img/h3.gif > </DD></DIV>
<DIV id=Layer3><DD><IMG  src=horse_img/h4.gif > </DD></DIV>
<DIV id=Layer4><DD><IMG  src=horse_img/h5.gif > </DD></DIV>
<DIV id=Layer5><DD><IMG  src=horse_img/h6.gif > </DD></DIV>
<DIV id=Layer6><DD><IMG  src=horse_img/h7.gif > </DD></DIV>
<DIV id=Layer7><DD><IMG  src=horse_img/h8.gif > </DD></DIV>
<%
 dim horsename(8)
 horsename(1)=h1
 horsename(2)=h2
 horsename(3)=h3
 horsename(4)=h4
 horsename(5)=h5
 horsename(6)=h6
 horsename(7)=h7
 horsename(8)=h8
 win=Request.Form("win")
 pledge=Request.Form("pledge")
%>
<form method="post" action="result.asp" id=form1 name=form1>
  <table width=750 border=1 bgcolor=#ffffff cellpadding="3" cellspacing="0">
    <tr bordercolor="#000099"> 
      <td colspan=4 align=center style="background:#ffffff;color:#000000"> 
        <div align="left"><b>比赛开始:</b><br>
        您选择的是 <font color="#FF0000"><b><%=win%></b></font> 号马 <font color="#FF0000"><b><%=horsename(win)%></b></font>,投注额为 <font color="#FF0000"><b><%=pledge%></b></font> NG。</font></div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width=14 valign="middle" align="center" height="20"><font color="#000099">1</font></td>
      <td width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse0"  value='<%=horse(0)%>'>
         </font></td>
      <td width=86 height="7%" align="center"> 
<font color="#000099"><%=h1%></font>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width="14" valign="middle" align="center" height="20"><font color="#000099">2</font></td>
      <td width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse1"  value='<%=horse(1)%>'>
         </font></td>
      <td width="86" height="7%" align="center"> 
       <font color="#000099"><%=h2%></font>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width="14" valign="middle" align="center" height="20"><font color="#000099">3</font></td>
      <td width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse2"  value='<%=horse(2)%>'>
         </font></td>
      <td width="86" height="7%" align="center"> 
       <font color="#000099"><%=h3%></font>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width="14" valign="middle" align="center" height="20"><font color="#000099">4</font></td>
      <td width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse3"  value='<%=horse(3)%>'>
         </font></td>
      <td width="86" height="7%" align="center"> 
       <font color="#000099"><%=h4%></font>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width="14" valign="middle" align="center" height="20"><font color="#000099">5</font></td>
      <td width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse4"  value='<%=horse(4)%>'>
         </font></td>
      <td width="86" height="7%" align="center"> 
       <font color="#000099"><%=h5%></font>
      </td></tr><tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width="14" valign="middle" align="center" height="20"><font color="#000099">6</font></td>
      <td width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse5"  value='<%=horse(5)%>'>
        </font></td>
      <td width="86" height="7%" align="center"> 
       <font color="#000099"><%=h6%></font>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width="14" valign="middle" align="center" height="20"><font color="#000099">7</font></td>
      <td width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse6"  value='<%=horse(6)%>'>
        </font></td>
      <td width="86" height="7%" align="center"> 
       <font color="#000099"><%=h7%></font>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF" bordercolor="#000099"> 
      <td width="14" valign="middle" align="center" height="20"><font color="#000099">8</font></td>
      <td height="31" width="624"> <font color="#000099"> 
        <input type=hidden readonly maxlength=3 size=3 name="horse7"  value='<%=horse(7)%>'>
        </font></td>
      <td width="86" height="7%" align="center"> 
       <font color="#000099"><%=h8%></font>
      </td>
    </tr>
    <tr width=100% bgcolor="#FFFFFF" bordercolor="#000099"> 
      <input type=hidden maxlength=3 size=3 name="horsewin" value='<%=horseto%>'>
      <input type=hidden maxlength=3 size=3 name="prize" value='<%=horseto%>'>
    </tr>
  </table>
</FORM>
</body>
<% end if
end if
end if
end if%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?