SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Voting Script Problem

    Several games have a suspision that the first game in the rankings right now is cheating somehow maybe with proxies. I have tried to block proxies with the following script, but it doesn't seem to work completely right and it is very slow. Does anyone know of a way to secure my vote script more than just checking the IP and setting a cookie?

    PHP Code:
    <?
    $portcheck 
    = array('80','81','128','3127','3128','6588','8000','8080','8081','8487','8888');    // Your list of comment ports. Remember not to many or script will fail.
    $passproxy = array('localhost');                                                                // I.P. address to let pass the check.
    $blockhost = array('');                                                                         // Block a known host or I.P.
    $nopass "error message";                                   // If proxy is found and not on the pass list send them to the location you choose.
    $SocketTimeout 1;                                                                             //  1 is about a 6 second wait. Higher the number longer the wait and more secure the check is.
     
    if ((!in_array($REMOTE_ADDR$blockhost)) && (!in_array($REMOTE_ADDR$passproxy)))
     {
      
    $num 0;
       while (
    $portcheck[$num])
       {
        
    $fSockPointer fsockopen($REMOTE_ADDR$portcheck[$num], $errno$errstr$SocketTimeout);
         if (
    $fSockPointer)
         {
         echo 
    $nopass;
         
    fclose($fSockPointer);
         }
        
    $num++;
       }
     }
     else
     {
      if (
    in_array($REMOTE_ADDR$passproxy))
      {  die();
      }
      else
      {
      echo 
    $nopass;
      die();
      }
     }
    ?>

  2. #2
    SitePoint Addict sinapra's Avatar
    Join Date
    Sep 2004
    Location
    secunderabad
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can write a shell script where you can block the IPs and other unwanted users to be blocked permanently without you needing to add the script in your page. You can set an automail where users would receive an email unless they are logged in with some email. its a socket kinda handling it.
    Regards

    Its Great to work and Be Merry!!!!!!!!

  3. #3
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Erm, well I don't want to block users, I want the voting page secure. I don't try and hide from people, I try to fix the problem.

  4. #4
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone have any ideas? This problem is really hurting my site.

  5. #5
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Raleigh, NC
    Posts
    783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you know the issues with client-side (cookie based) and server-side (ip based). my suggestion: only allow voting for logged in registered users

  6. #6
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Darchangel
    you know the issues with client-side (cookie based) and server-side (ip based). my suggestion: only allow voting for logged in registered users
    That would work, but it would also have the same affect as if I just went ahead and closed the site down. Users just click on a vote link from a game and vote, so most are not going to register just so they can vote.

  7. #7
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone have anything? This is important...

  8. #8
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Blocking proxies wont work due to the fact that song people need to access the internet thorugh them. Basicaly the only way I see it is is to do what Darchangel said or live with people using proxies.

    Off Topic:


    You're James, right?

  9. #9
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I am James.

  10. #10
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, I'm Mutt's friend.

  11. #11
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh right, I thought your username was familiar

  12. #12
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, but seriously--

    Librarys and such use proxies to get on to the internet, so it'd be counter-productive to ban all proxies.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •