You can get the user's like this:
$users_ip = $_SERVER['REMOTE_ADDR'];
Don't use text files (as this will be bad for your HDD, too much I/O); instead use database.
When user arrives at the vote script:
- Check if this IP has a record in your db table
- If the IP has a record, check when the user last voted and compare with current time
If the timespan from his last vote > what it should be, let him vote, update db table for that ip "last_vote"
If the user doesn't have a record in db (first vote); insert a db table row with the ip and current timestamp