⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vote.asp

📁 ASP入门与提高实用教程 源文件(上传网站)
💻 ASP
字号:
<!--#include file="conn.asp"--><%
dim sql,rs
dim lastid
dim multi

lastid=encodestr(Request.querystring("ID"))


  Set rs = Server.CreateObject("ADODB.Recordset")
if lastid="" then
  sql="select top 1 id from vote order by id desc"
  rs.open sql,conn,1,1
  
  if rs.eof then
   rs.close
   set rs=nothing
   response.write "没有记录!"
   response.end
  end if
  
  lastid=rs(0)
  rs.close
end if
  
  sql="select * from vote where id="&lastid&" order by options"
  rs.open sql,conn,1,1
  
  if rs.eof then
   rs.close
   set rs=nothing
   response.write "数据已经被破坏!"
   response.end
  end if
  multi=rs("multi")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {color: #0000CC}
.style4 {
	color: #3366FF;
	font-style: italic;
}
.ttr {
	color: #3366FF;
	margin: 0px;
	padding: 0px;
	border-top: thin none;
	border-right: medium none;
	border-bottom: 1px dotted #A4D1FF;
	border-left: thin none;
}
-->
</style>
</head>

<body>
<form name="form1" method="post" action="votedo.asp">
  <table width="200"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#9B9BFF">
    <tr>
      <td width="21%" height="35" bgcolor="#BBD3F4" class="style4">投票:<%= rs("title") %></td>
    </tr>
    <tr>
      <td height="168" bordercolor="#333333" bgcolor="#D7E8FB">
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <% 
	  rs.movenext
	  while not rs.eof %>
          <tr valign="middle">
            <td width="4%" class="ttr">
            <%if multi=0 then%>
            <input name="svote" type="radio" value="<%= rs("options") %>">
            <%else%>
            <input name="mvote" type="checkbox" value="<%= rs("options") %>">
            <%end if%>
            </td>
            <td width="8%"  class="ttr"><strong class="style1"> <%= Chr(64+rs("options")) %></strong></td>
            <td width="88%" class="ttr"> &nbsp;<%= rs("title") %> </td>
          </tr>
          <%
	   rs.movenext
	  wend 
	  %>
      </table>
      </td>
    </tr>
    <tr>
      <td><table width="100%" height="28"  border="0" cellpadding="0" cellspacing="0" bgcolor="#B3B8D9">
        <tr>
          <td width="47%" align="center"><input name="ID" type="hidden" id="ID" value="<%=lastid%>">          <input name="multi" type="hidden" id="multi" value="<%=multi%>">
          <input type="submit" name="Submit" value="提交"></td>
          <td width="53%" align="center"><input type="reset" name="Submit2" value="重置"></td>
          </tr>
      </table></td>
    </tr>
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

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