AJAX IP Poll

Discussion in 'PHP' started by asgsoft, Jul 1, 2007.

  1. #1
    asgsoft, Jul 1, 2007 IP
  2. B.V.E.

    B.V.E. Peon

    Messages:
    106
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your site doesn't seem to want to load, but here's a very basic idea anyway:

    
    //- Make a table just to store IP Addresses, let's call it IPTable in this example
    //- Create and write the following function:
    
    Function AllowedToVote(){
    	1) Get the IP Address of the visitor
    	2) Check if the IP Address already exists in the IPTable
    	---If yes: return False;
    	---If not: do nothing and continue to step 3
    	3) Add IP Address to the IPTable, and return True
    
    //- Just call this function before the Vote will be processed and added to the database by the original script, i.e.:
    
    if(!AllowedToVote()){
      //Exit, stop, call another function, display "you've already voted", etc..
    }
    
    }
    Code (markup):
    It's pretty basic but it should do the job.
     
    B.V.E., Jul 1, 2007 IP
  3. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #3
    are there any pre-made ones you know of that are in AJAX and also have IP control yet are free/opensource?
     
    asgsoft, Jul 2, 2007 IP