PDA

View Full Version : users IP address!!!


ACJavascript
03-08-2004, 12:40 AM
Hello All,

Okay, I need to get the users IP address, I do not mean the relative one they get everytime they go on the net I want the computer IP address. I am using this code now:

$_SERVER["REMOTE_ADDR"];

which returns something like 123.122.153.123

Thats cool and all but when my user votes on the question if they just restart the internet they can vote again.

So I need their actual IP address to prevent multiple votes.


ANY idea is much appreciated!

mordred
03-08-2004, 12:51 AM
Restart the internet? Where is this button? :D

I'm not sure what you're after, the IP address of a user is just the one contained in $_SERVER['REMOTE_ADDR']. Do you mean the MAC address?

ACJavascript
03-08-2004, 01:04 AM
Hey mordred,

Well, I ran a test, I would open test.php and save the IP address to my mysql database. Then exit the net (i use AOL) then go back to the script and do it again.

Once I did this a couple times I pulled the table and each times there was a different IP address.

Thats not very good for a voting script. :(

Now, on this website it doesn't matter if you get off the net or restart once you vote you vote.

Mabye there using usernames to check, but Im sure theres a way with a IP address. (or mac address but Im not sure what that is)

Len Whistler
03-08-2004, 01:08 AM
I'm 96% sure that you can't get a computers ID. What you have will have to do.

Leonard Whistler
http://www.stubby.ca

STDestiny
03-08-2004, 01:17 AM
The best way around that would be to set a cookie, but of course if the user turns off cookie, that wouldn't work. (though you could require a username/password, but you could get around that too)

-Andrew

Yusogga
03-08-2004, 03:00 AM
Because of anonymous proxies and dynamic ips,
you can't really rely on IP to trace an identity...
Retreiving the MAC address seems to be a better solution.

I saw some site getting your mac address, just not sure how they did it.

mordred
03-08-2004, 08:15 AM
I don't think you can easily get the MAC address, from my point of understanding IP routing, you would only get the address of the last routing point, not the computer which sent the packet originally? Not sure though.

See also
http://lists.evolt.org/archive/Week-of-Mon-20030526/141383.html
http://www.faqts.com/knowledge_base/view.phtml/aid/14440/fid/51

If you want to prevent people from cheating your poll script, you'll need them to register by email, and have them confirm every registration. That doesn't prevent fraud by itself, but it makes the hassle greater for those who'd like to submit multiple times and leaves a trail to the cheater.

ACJavascript
03-08-2004, 08:32 PM
THanks everyone, I think I will just have to collect the IP and leave it at that, if it gets to silly I will setup a member system.

Thanks everyone!!! :D

duniyadnd
03-08-2004, 09:24 PM
what you could do is put a cookie on that person's computer (see setcookie() function) and if that cookie exists, then don't allow that person to vote.

ACJavascript
03-08-2004, 09:33 PM
That would work for a bit, but the user only has to remove the cookie from there temp folders and they can vote again. :(

missing-score
03-08-2004, 09:47 PM
think about it though... there is no way to stop someone voting twice or more times, if you setup the IP and cookie that should be enough... If someone really wants to annoy you they are going to get bored disconnecting, reconnecting and deleting cookies!

imaek
03-08-2004, 09:58 PM
You Could Just Use Wildcards :-/

for Example: 127.0.0.*

duniyadnd
03-08-2004, 10:01 PM
That would work for a bit

Yeah, but if ppl would really go through the trouble of deleting cookies to just vote, you can imagine that they will go through the trouble to do anything to vote. The only way you can truly ensure that they don't revote is using a login system, where each person has to register, but even after that, it's hard, since the person can create multiple accounts. Maybe login for only one UNIQUE email address.

ACJavascript
03-08-2004, 10:18 PM
The login system is probably the best way to go about it with the unique emails.

I dont know about your guys/gals computers but when I restart my computer all my cookies are removed.

I didn't want to go and code a member system :(

but I gues I am going to have to hehehe :D

STDestiny
03-09-2004, 03:45 AM
Originally posted by duniyadnd
Maybe login for only one UNIQUE email address.

Then people would just register multiple hotmail or yahoo accounts.

Unfortunately, there is no surefire way to keep anyone from voting more than once unless you control the entire network of computers that people can vote on (say, for example, electronic voting booths that are starting to become more frequent here in the US)

-Andrew

Yusogga
03-09-2004, 05:45 AM
Unfortunately, there is no surefire way to keep anyone from voting more than once unless you control the entire network of computers that people can vote on (say, for example, electronic voting booths that are starting to become more frequent here in the US)

Talking about that, did you know that it's going to be used in almost half of the states, besides the fact that they found tons of security holes, has been hacked easily by professionals, has already 6 patch releases.... (::: You don't know who you are going to vote for ::: )))

As for the login as protection, it's true that they can still create a new account with a new created email, but the hassle of doing this should discourage more than one malicious user.

Then if you really want peace, open up a paypal account and make them pay (if you offer more than voting of course :p )