Distinguish Unique Users

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
damo
Forum Newbie
Posts: 1
Joined: Tue Jul 08, 2008 6:12 pm

Distinguish Unique Users

Post by damo »

Hi

In our app at the moment we have a requirement to rate certain things from 1 to 5.
We dont want a user rating a particular object more than once.
At the moment we store all the ip addresses along with the ratings for the particular object so we can do a like query on this field based on ip address of user.

The problem is with $ip = $_SERVER['REMOTE_ADDR'];
this returns the network ip address.
If i am at home and i rate an item, my friend cannot rate the same item because $_SERVER['REMOTE_ADDR']; returns the same ip address.

Any ideas how we could distinguish between users that are in a network or behind a router?

Any help is greatly appreciated

Thanks
Damien
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Re: Distinguish Unique Users

Post by Stryks »

I imagine your best bet is to get users to log in in order to submit a rating and just hide or disable items they have already rated.

A person could have multiple accounts, true, but if someone goes through the process of registering twice, then just accept that they feel twice as strongly as most people, and can therefore be seen as two entities that happen to feel the same way.

IP tracking is weak at best. It seems good, but there are too many variables that are way outside your control.

If you wanted to use IP's in some constructive way, then just use it as an warning flag. Say, store IP's on signup and compare to IP's used in previous signups. Find a recent match and set a warning. Get a rating from one, then an identical rating from another account with the same IP, then set a warning. Over time, your two accounts doing similar things from the same IP will raise enough flags (say 10 or 15) for you to safely say, let's mark both as having rated an item when either one does.

Cheers
Post Reply