cs2.asp

来自「使用FLASH和 ACCESSASP 结合制作的投票系统」· ASP 代码 · 共 70 行

ASP
70
字号
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/tp.asp" -->
<%
Response.Expires=0

if Request.Cookies("toupiao")<>"true" then
if Request.QueryString("jieguo")="1" then
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_tp_STRING
Command1.CommandText = "UPDATE 投票数据  SET 同意=同意+1  WHERE ID=1 "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
Response.Cookies("toupiao")="true"
Response.cookies("toupiao").expires="9/9/2008"  '通过cookies限制多次投票
elseif Request.QueryString("jieguo")="2" then
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_tp_STRING
Command1.CommandText = "UPDATE 投票数据  SET 不同意=不同意+1  WHERE ID=1 "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
Response.Cookies("toupiao")="true"
Response.cookies("toupiao").expires="9/9/2008"  '通过cookies限制多次投票
elseif Request.QueryString("jieguo")="3" then
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_tp_STRING
Command1.CommandText = "UPDATE 投票数据  SET 无所谓=无所谓+1  WHERE ID=1 "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
Response.Cookies("toupiao")="true"
Response.cookies("toupiao").expires="9/9/2008"  '通过cookies限制多次投票
end if

else
%>
&yjtj12=true23&
<%
end if
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_tp_STRING
Recordset1.Source = "SELECT * FROM 投票数据"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0




%>


&&&&&rrrm=<%=rnd(12324143)*10000%>&type1=<%=(Recordset1.Fields.Item("同意").Value)%>&type2=<%=(Recordset1.Fields.Item("不同意").Value)%>&type3=<%=(Recordset1.Fields.Item("无所谓").Value)%>&&&ok=true&
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

⌨️ 快捷键说明

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