<!--#include virtual="Conn/Conn.asp"-->
<%
id=request("id")
'记录投票者IP
Set rs = Server.CreateObject("ADODB.RecordSet")
rssql="Select * from baoming_ip where IP='"&Request.ServerVariables("REMOTE_ADDR")&"'"
rs.Open rssql,conn,3,2
if (not rs.eof) and datediff(s,rs("VisitTime"),now())<86400 then
%>
<script language="javascript">
alert("你已经投过票,24小时以内不能重复投票!");
window.location.href='/xceShowClass.asp';
</script>
<%
response.End
end if
rs.close
set rs=nothing
'记录投票者IP
Set rs = Server.CreateObject("ADODB.RecordSet")
rssql="Select * from baoming_ip"
rs.Open rssql,conn,3,2
rs.addnew
rs("IP")=Request.ServerVariables("REMOTE_ADDR")
rs("VisitTime")=now()
rs.update
rs.close
set rs=nothing
'增加投票数量
Set rs = Server.CreateObject("ADODB.RecordSet")
rssql="Select Hits from baoming where id="&id
rs.Open rssql,conn,3,2
rs("Hits")=rs("Hits")+1
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language="javascript">
alert("投票成功!");
window.location.href='/xceShowClass.asp';
</script>