|
我写的代码是这样的,怎么改啊?
<!--#include file="Inc/IndexConn.asp"-->
<!--#include file="Inc/SiteMsg.asp" -->
<%
id=request("id")
if request.ServerVariables("REMOTE_ADDR")=request.Cookies("IPAddress") then
SiteMsg 2,"您已经投过票了,请不要重复投票!","zpzs.asp"
else
response.cookies("IPAddress")=request.ServerVariables("REMOTE_ADDR")
response.cookies("IPAddress").Expires=Date()+1
end if
set rs=Server.CreateObject("adodb.recordset")
sql="select * from pic1 where id="&id
rs.open sql,conn,1,3
rs("ps")=rs("ps")+1
rs.update()
rs.close
set rs=nothing
SiteMsg 2,"投票成功!","zpzs.asp"
%>
由上可见,你指完票后就写入Cookies("IPAddress"),你可再多写一个Cookies("IPcount")=1
判断时多一项,
if request.ServerVariables("REMOTE_ADDR")=request.Cookies("IPAddress") then
if Cookies("IPcount") =3 then
SiteMsg 2,"您已经投过票几次了,请不要重复投票!","zpzs.asp"
else
-------
else
指一次就加将Cookies("IPcount")加一, |
|