写一个投票程序
index.asp 投票页
tijiao.asp 处理页
要求票数记录在数据库中
tiyiao.asp怎么获取index.asp提交的数据
index.asp
部分内容
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style5 {
font-size: 36px;
font-family: "黑体", "楷体_GB2312", "新宋体";
color: #FF0000;
}
body,td,th {
font-family: 黑体, 楷体_GB2312, 新宋体;
font-size: 16px;
color: #0033FF;
}
body {
background-color: #33CCFF;
}
-->
</style>
</head>
<body>
<div align="center"><span class="style5">喜欢的影视歌明星网络投票系统</span>
</div>
<hr align="center" noshade class="style5">
<%
'显示明星按得票多少排序
set conn=server.createobject("adodb.connection")
strconnect="provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Inetpub\wwwroot\toupiaox/user.mdb'"
conn.open strconnect
set rs=server.createobject("adodb.recordset")
sql="select * from mingxing "
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "目前没有明星记录!"
else
counts=5
rs.pagesize=counts
allpages=rs.pagecount
page=request("page")
if not isnumeric(page) then page=1
if isempty(page) or cint(page)<1 then
page=1
elseif cint(page)>=allpages then
page=allpages
end if
rs.absolutepage=page
do while(not rs.eof) and counts>0
%>
<form action="toupiao.asp?" method="get" name="form1">
<table align="center">
<tr>
<td>
<th align="left">
<input name="elect" type="radio" value=rs("username")>
<%=rs("username")%></th></td>
<td><%=rs("piao")%></td>
<%session("name")=rs("username")%>
</tr>
<%
counts=counts-1
rs.movenext
if rs.eof then exit do
loop
end if
%>
</table>
<p align="center">
<input type="submit" value="投票" name="submit">
</P>
</form>
<table align=center>
<tr>
<td height=50 valign=top align=center>
<%
response.write "<br> 当前共有"&rs.recordcount&"条明星记录"
if page=1 then
response.write "<font color=drkgray>首页 上页</font>"
else
response.write "<a href=index.asp?page=1>首页</a><a href=index.asp?page="&page-1&">上页</a>"
end if
if page=allpages then
response.write "<font color=darkgray>下页 末页</font>"
else
response.write "<a href=index.asp?page="&page+1&">下页</a><a href=index.asp?page="&allpages&">末页</a>"
end if
response.write "第"&page&"页 共"&allpages&"页"
%>
</td>
</tr>
</table>
</form>
<hr align="center" noshade>
<form name="form2" method="post" action="submit1">
<div align="center">明星搜索
<input name="name" type="text" id="name" value="请输入明星姓名" size="50">
<input type="submit" name="Submit" value="提交">
</div>
</form>
</body>
</html>