ive just being playing around with a little polling script, and ive added some code to stop users from voting twice, by adding their ip address using $REMOTE_ADDR to a file.
its a little strange however, because it stops them voting more than once initially but after a some period of time they are able to vote again.
here is my code
when they vote its adds the ip address to a file called poll.log
using this statement:
fputs($fp, $REMOTE_ADDR . "\n");
and before they vote its checks using this code:
//Check IP address again poll.log
$logData = file($LOG_FILE);
$noAddresses = count($logData);
for($i = 0; $i < $noAddresses; $i++)
if(trim($logData[$i]) == $REMOTE_ADDR)
$match = true;
$match = false;
if($match == true)
//show cant vote twice page
//show vote page
can anyone see anything wrong? im clueless.
cya later fellas