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

📄 votepoll.asp

📁 一个超级漂亮的班级主页asp代码
💻 ASP
字号:
<!--插入html头部分以及数据库接口-->
<!--#include file="in_conn.asp"-->




<body>
<!--插入网站置顶-->
<% if u_name="" then
	Response.Redirect "log_err.asp"
else
%>
<!--#include file="in_topmb.asp"-->
<% end if %>

<%
'判断用户权限
IF u_power=0 THEN
	Response.Redirect "resp.asp?cmd=id_wait"
ELSEIF u_power<0 THEN
	Response.Redirect "resp.asp?cmd=id_forbid&time="&u_fobdate
END IF


vkind=Request.Form("hid_kind2")
'版面是否存在
dim kind_name
IF isNumeric(Request.Form("hid_kind2")) THEN
	vkind=CLng(vkind)
	'找出该版面的相关信息
	sqlstr="SELECT kd_name FROM tblkind WHERE kd_ID="&vkind
	rs.open sqlstr,conn,1,1
		if rs.eof AND rs.bof then
			Response.Redirect "resp.asp?cmd=kindmiss"
		else
			kind_name=rs("kd_name")
		end if
	rs.close
ELSE
	Response.Redirect "resp.asp"
END IF




'获取传值
dim visradio
visradio=CBool(Request.Form("isradio"))

dim opval
dim vtid
vtid=Request.Form("topicID")

'检查是否重复投票
sqlstr="SELECT count(v_ID) FROM tblvote WHERE v_enable=true AND v_voter='"&u_name&"' AND v_topicID="&vtid
if conn.Execute(sqlstr,0,1)(0)>=1 then
	Response.Redirect "resp.asp?cmd=revote"
end if


'投票登记
IF visradio=false THEN
	for i=1 to Request.Form("vop()").count
		opval=CStr(Request.Form("vop()")(i))
		sqlstr="INSERT INTO tblvote(v_topicID,v_option,v_voter,v_enable,v_only1) VALUES("&vtid&",'"&stryin(opval)&"','"&u_name&"',true,false)"
		conn.Execute sqlstr
	next
	'检查是否为空票
	if Request.Form("vop()").count<1 then
		Response.Redirect "resp.asp?cmd=votemiss"
	end if
ELSE
		opval=CStr(Request.Form("vop"))
		sqlstr="INSERT INTO tblvote(v_topicID,v_option,v_voter,v_enable,v_only1) VALUES("&vtid&",'"&stryin(opval)&"','"&u_name&"',true,true)"
		conn.Execute sqlstr
END IF
%>


<table align="center" width="700" height="50" border="0" cellspacing="0" cellpadding="11" class="rdkuang"><tr>
	<th width="100%" height="100%" align="left">

	<img src="img/jjgo.gif" border=0>恭喜,您的投票已被成功登记!谢谢参与!
	<br>请选择接下来的操作:<font color="red">(系统在3秒后将自动转向您刚发表的投票主题)</font>
	<br><a href="voteview.asp?id=<% =vtid %>"><img src="img/icn_go.gif" border="0">返回相关投票主题</a>
	<br><a href='talklist.asp?kind=<% =vkind %>'><img src="img/icn_go.gif" border="0">返回到 <% =unhtml(kind_name) %></a>
	<br><a href="talkbook.asp"><img src="img/icn_go.gif" border="0">返回[班级讨论区]</a>
	<br><a href="index.asp"><img src="img/icn_go.gif" border="0">返回首页</a>

	</th>
</tr></table>

<script defer language="javascript">
	setTimeout('location.href="voteview.asp?id=<% =vtid %>"',3000);
</script>

<br>
<!--插入在线统计-->
<!--#include file="in_online.asp"-->
<!--插入网站置底-->
<!--#include file="in_bottom.asp"-->
</body>

</html>

⌨️ 快捷键说明

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