|
Posted by xclarky on 02/06/06 21:04
You could store it in a file yes, a MySQL backend would be better
though.
I assume you know how to append data to files, with this you can add IP
addresses with a divider (new line, tab, any character you like). You
can read that file during the processing of the poll and create an
array of IP's:
[PHP]
$voted = explode('MYDIVIDER', $contents_of_file);
[/PHP]
You can then check the current visitors IP against this array:
[PHP]
if(in_array($_SERVER['REMOTE_ADDR'], $voted)) {
die('You have already voted!');
{
[/PHP]
I hope that helps.
[Back to original message]
|