in reply to Checking user's IP....
You could log the IP addresses to a file and then search it. If you're running your site with a database you could log them to a table.
if you want code for a database solution let me know$address=$ENV{REMOTE_ADDR}; open FILE, "<logaddresses.dat"; my $addresses; { local $/=undef; $addresses=<FILE>; } close FILE; if($addresses=~/\Q$address/){ print "You already voted\n"; } else{ open FILE, ">>logaddresses.dat"; print " $address\n"; close FILE; # update poll; } #display results;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: RE: Checking user's IP....
by Anonymous Monk on Sep 13, 2001 at 19:36 UTC |
In Section
Seekers of Perl Wisdom