php - how to save ip address in database -
i creating voting website in person can vote once. want make sure person can vote in every 3 hour. technically speaking want save ip address , cookie whenever person click on vote button vote should increase 1 , person should not able vote 3 hour. want run session save ip , cookie 3 hours. have multiple entries on 1 page. don't know way go either saving database or other method. don't have advance knowledge of php guys please me out stuck here.
you can capture ip address
$_server['remote_addr'];
every time if user clicks on vote
, first capture ipaddress. run query select * table ipaddress = "current ip address" , question number = id , time difference >= 3 hours
if ip address present, user has answered, else increment votes.
Comments
Post a Comment