broncozr
05-21-2009, 04:01 AM
Can $_SERVER['REMOTE_ADDR'] ever return a null or "false" value?
I'm wanting to do a poll on my site, and I want to limit votes by cookie and by ip address. I'm going to record the ip's in a MySQL database table as they vote. If I get a match on the ip (mysql_num_rows>0), then the option to vote is not offered. However, I'm concerned that $_SERVER['REMOTE_ADDR'] will return a value that will block subsequent users.
For example, user 1 shows an ip of "null," and my code inserts "null" into the database. The next user also shows an ip of "null," and my code does not allow him to vote.
Is this a problem? If so, is there a fix/hack?
Thanks.
I'm wanting to do a poll on my site, and I want to limit votes by cookie and by ip address. I'm going to record the ip's in a MySQL database table as they vote. If I get a match on the ip (mysql_num_rows>0), then the option to vote is not offered. However, I'm concerned that $_SERVER['REMOTE_ADDR'] will return a value that will block subsequent users.
For example, user 1 shows an ip of "null," and my code inserts "null" into the database. The next user also shows an ip of "null," and my code does not allow him to vote.
Is this a problem? If so, is there a fix/hack?
Thanks.