Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    28

    Unanswered: IP log and denial

    Ok i have a poll that people can vote on. I want only someone to vote 5 times max. I created an ip field in my database and i am able to capture the users IP address. Im assuming i would have some code that would check for how many instances an ip are in the database and if less than 5 allow the votes to get submitted otherwise pop up an error. if anyone can steer me in the right direction i would greatly appreciate it.

  2. #2
    Join Date
    Nov 2004
    Posts
    28
    ok i was able to get the php and sql statement to make a list of distint IP's and count how many times they show up.

    I have the following to capture the current users IP:

    $ip = $_SERVER['REMOTE_ADDR'];


    Here is to list the distint IP's and count how many times they appear

    $count = mysql_query("select distinct(ip), count(ip) FROM Choices GROUP BY ip");

    now how would i compare the current IP ($ip) with the ones from the generated list and see if that one appears 5 times or more. If it appears 5 then the user is directed to another page.

Posting Permissions

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