这个网站是一个投票的,一个是赞成,一个是反对。http://www.hfweb.cn/civi/Show.asp?ID=7,如果投赞成票,一天只能投一次,必须第二天才能投第二票,改时间没用,清空COOKIE也没有用。不知道这个COOKIE怎么写的。请高手指点。

解决方案 »

  1.   

    Cookie里面不是设置了过期时间的吗,这个过期时间是不是一天24小时呢,你是手动清除cookie的吗?
      

  2.   

    用IP 时间 做主键吧(不过ip重新拨号后,都会变化,还有工具可以不断改ip)增加一个邮箱,往邮箱里面发一个验证码,投票时,要用这个验证码(这个一天一个邮箱只能发一个好确认)。不过邮箱也可以注册n个,只不过费事(没有改ip的工具时,还要重新拨号)。
    做到上面这一步就行了。再高级点可以往手机里发验证码,这个就太费事了,估计就没有人愿意投票了。
      

  3.   


    应该不是保存到数据库中的,因为我禁用了cookie后,网站就会提示不能投票,要开户cookie.
      

  4.   


    试过了。不行的。IP换了,COOKIE也清了。
      

  5.   

    如果他们是把ip和时间作为信息存入数据库,你改cookie当然没有用。
      

  6.   

    先确定一下是不是cookie的原因。方法,你在新建一个用户(计算机的用户)使用这个用户登录,看看能不能投票(这时肯定用不到之前用户的cookie了)。
      

  7.   

    以下js代码可以获取你的mac你把mac地址也改了试试,(不会改的话,百度)
    <HTML><HEAD><TITLE>WMI Scripting HTML</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <SCRIPT language=JScript event="OnCompleted(hResult,pErrorObject, pAsyncContext)" for=foo>
     document.forms[0].txtMACAddr.value=unescape(MACAddr);
     document.forms[0].txtIPAddr.value=unescape(IPAddr);
     document.forms[0].txtDNSName.value=unescape(sDNSName);
     //document.formbar.submit();
      </SCRIPT>
    <SCRIPT language=JScript event=OnObjectReady(objObject,objAsyncContext) for=foo>
       if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined" && objObject.IPEnabled == true)
       {
        if(objObject.MACAddress != null && objObject.MACAddress != "undefined")
        MACAddr = objObject.MACAddress;
        if(objObject.IPEnabled && objObject.IPAddress(0) != null && objObject.IPAddress(0) != "undefined")
        IPAddr = objObject.IPAddress(0);
        if(objObject.DNSHostName != null && objObject.DNSHostName != "undefined")
        sDNSName = objObject.DNSHostName;
        }
    </SCRIPT>
    <META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
    <BODY>
    <OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT></OBJECT>
    <OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223></OBJECT>
    <SCRIPT language=JScript>
       var service = locator.ConnectServer();
       var MACAddr ;
       var IPAddr ;
       var sDNSName;
       service.Security_.ImpersonationLevel=3;
       service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
    </SCRIPT>
    <FORM id="formfoo" name="formbar" action="index.do" method="post">
    <INPUT value="00-11-11-B4-52-EF"   name="txtMACAddr"> 
    <INPUT value="210.42.38.50"  name="txtIPAddr"> 
    <INPUT value="zhupan" name="txtDNSName"> 
    </FORM></BODY></HTML>
      

  8.   

    <%
    option explicit
    Response.Buffer = True 
    Response.ExpiresAbsolute = Now() - 1 
    Response.Expires = -1
    Response.CacheControl = "no-cache" 
    const ZanTime=1 '赞成票投票时间
    const FanTime=2
    const TimeDanWei="d"'时间间隔的单位天
    const TimerStr="天"
    dim JianTime,Action,AlertStr,UserID
    Action=Hu_Clng(request("Action"))
    if ACtion>4 or Action<2 then Action=4
    UserID=request.Cookies("Civi")
    if UserID="" then
    AlertStr="浏览器cookies功能未打开、手动清除了cookies或系统还原"
    end if
    ComeUrl = Trim(Request.ServerVariables("HTTP_REFERER"))
    if ComeUrl="" then
    AlertStr="不允许直接输入地址访问本系统"
    elseif  LCase(Trim("http://" & Request.ServerVariables("SERVER_NAME")))<>LCase(Left(ComeUrl, InStr(8,ComeUrl, "/")-1)) then
    AlertStr="不允许从外部链接地址访问本系统"
    end if
    if AlertStr<>"" then
    response.Write "<script language='javascript'>alert("""&AlertStr&""");window.location="""&comeurl&""";</script>"
    response.end()
    end if
    %>
    <!--#include file="conn_tupiao.asp" -->
    <!--#include file="civicode.asp" -->
    <%
    select case Action
    case 3
    JianTime=ZanTime
    call Zan("ZanChen")
    case 4
    JianTime=FanTime
    call Zan("FanDui")
    end select
    call CloseConn_tupiao()
    if AlertStr<>"" then
    response.Write "<script language='javascript'>alert("""&AlertStr&""");window.location="""&comeurl&""";</script>"
    response.end()
    end ifsub Zan(str)
    dim TuPiao,idArr,i,ErrStr,sql,SucStr,rs,DanWeiName
    dim NowTime,s1,s2,s3,timestr,UserStr
    NowTime=now()
    tuPiao=Hu_clng(request.QueryString("tuPiao"))
    if tuPiao<=0 then
    AlertStr="您没有选择任何单位"
    exit sub
    end if
    set rs=conn_tupiao.execute("select DanWeiName,TuDate from YongFu where userID='"&userID&"'")
    if rs.eof then'未找到记录,手动修改了cookies
    set rs=nothing
    response.Cookies("Civi")=""
    AlertStr="浏览器cookies功能未打开或手动修改了cookies"
    exit sub
    else'找到记录,需要检查投票情况
    if datediff(TimeDanWei,rs("TuDate"),NowTime)<jianTime then
    AlertStr="您访问本系统未达到"&jianTime&TimerStr&",请过"&jianTime-datediff(TimeDanWei,rs("TuDate"),NowTime)&TimerStr&"后再来投票,谢谢!"
    set rs=nothing
    exit sub
    end if
    On Error Resume Next
    DanWeiName=trim(rs("DanWeiName"))
    set rs=nothing
    if isnull(DanWeiName) then DanWeiName=""
    UserStr=DanWeiName
    s1=instr(DanWeiName,"["&TuPiao&"$")
    if s1>0 then'以前对该单位投过票
    s2=instr(s1,DanWeiName,"]")
    timestr=replace(mid(DanWeiName,s1,s2-s1),"["&TuPiao&"$","")
    if not IsDate(timeStr) then
    set rs=nothing
    AlertStr="系统出错,请与管理员联系!"
    exit sub
    end if
    if DateDiff(TimeDanWei,timestr,NowTime)<JianTime then
    ErrStr=TuPiao
    else
    SucStr=TuPiao
    UserStr=replace(DanWeiName,"["&TuPiao&"$"&timestr&"]","["&TuPiao&"$"&NowTime&"]")
    end if
    else
    SucStr=TuPiao
    UserStr=DanWeiName&"["&TuPiao&"$"&NowTime&"]"
    end if
    end if
    set rs=nothing
    if SucStr="" and ErrStr="" then
    AlertStr="您没有选择任何单位"
    exit sub
    end if
    if SucStr<>"" then
    '将用户投票情况写入数据库
    if UserStr="" then
    AlertStr="系统出错!"
    exit sub
    end if
    sql="update YongFu set DanWeiName='"&UserStr&"' where UserID='"&UserID&"'"
    conn_tupiao.execute sql
    '开始进行投票
    sql="update DanWei set "&str&"="&str&"+1"&" where Passed="&Hu_True&" and Del="&Hu_False&" and (id="&SucStr&")"
    conn_tupiao.execute sql
    '查找成功被投票的单位
    set rs=conn_tupiao.execute("Select DanWeiName from DanWei where Passed="&Hu_True&" and Del="&Hu_False&" and (id="&SucStr&")")
    if rs.eof then
    SucStr=""
    else
    SucStr=rs(0)
    end if
    set rs=nothing
    end if
    if ErrStr<>"" then
    set rs=conn_tupiao.execute("Select DanWeiName from DanWei where Passed="&Hu_True&" and Del="&Hu_False&" and (id="&ErrStr&")")
    if rs.eof then
    Errstr=""
    else
    ErrStr=rs(0)
    end if
    set rs=nothing
    end if
    if SucStr<>"" then
    AlertStr="您对“"&SucStr&"”的投票成功\n\n感谢您的参与!"
    else
    AlertStr="您对“"&Errstr&"”的投票失败\n\n失败原因:投票时间间隔未达到"&JianTime&TimerStr&"!"
    end if
    end sub
    %>