sinisake Posted May 7, 2008 Share Posted May 7, 2008 Hi, my question is more about DB/script optimization, because script could(possibly!) work with big number of users/votes/ratings... My client said that cookies will be fine. (I know that other ways - sessions and IP tracking have their disadvantages too...) To be more clear, everyone can vote, there is no registration/login... And, now i would like your suggestions about implementing of multiple voting prevention... What you would do? I have several solutions/suggestions: 1) all data stored in cookie(unique id and id's of pictures which has been rated, script should pull off picture id's from cookie) 2) cookie+DB -1.way All ratings/votes from same user in one field/one row! TABLE STRUCTURE: id,unique_id,picture_ids(separated by commas) for example 1, 1uu2145u55, 1,2,4,5,6 This way is good when there is no too many votes, but you can imagine what will be with number increasing... (i am using explode() function to get rated images id's) 3) cookie+DB -2.way EVERY RATING - ONE ROW IN DB same db structure, but: id,unique_id,picture_ids(separated by commas) for example: 1, 1uu2145u55, 1 1, 1uu2145u55, 2 1, 1uu2145u55, 3 Sorry for my English, i hope that you understand what i tried to say. So, what you would suggest?Is there any other(better) way? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/104642-how-to-prevent-multiple-votingratinghotornot-clone/ Share on other sites More sharing options...
DarkWater Posted May 7, 2008 Share Posted May 7, 2008 You can delete cookies and you then can expire. Make them register, otherwise you'll have a hell of time tracking them. Quote Link to comment https://forums.phpfreaks.com/topic/104642-how-to-prevent-multiple-votingratinghotornot-clone/#findComment-535621 Share on other sites More sharing options...
MattDunbar Posted May 7, 2008 Share Posted May 7, 2008 If your client said cookies are okay, just use them. If anything store an IP address and a question/picture id but then you'll have to worry about Dial Up users who share an IP address. SampleTable: IP,voteon 127.0.0.1,52 127.0.0.1,55 Then you could simply SELECT * FROM tablename WHERE ip='127.0.0.1' AND voteon='52' then run mysql_num_rows, if 0 is returned they haven't voted. Quote Link to comment https://forums.phpfreaks.com/topic/104642-how-to-prevent-multiple-votingratinghotornot-clone/#findComment-535622 Share on other sites More sharing options...
benphp Posted May 7, 2008 Share Posted May 7, 2008 capture and store their IPs - depending on how determined they might be to re-vote. It should be enough for most voting purposes, but if you really want to restrict voting, you could require registration. There are ways around that too - it's just a matter of how many people you think would bother to re-vote. Quote Link to comment https://forums.phpfreaks.com/topic/104642-how-to-prevent-multiple-votingratinghotornot-clone/#findComment-535623 Share on other sites More sharing options...
MattDunbar Posted May 7, 2008 Share Posted May 7, 2008 Most importantly, if you are running a contest track the winners IP and check how many votes are registered from a single IP most likely theirs. Quote Link to comment https://forums.phpfreaks.com/topic/104642-how-to-prevent-multiple-votingratinghotornot-clone/#findComment-535625 Share on other sites More sharing options...
sinisake Posted May 7, 2008 Author Share Posted May 7, 2008 Thanks people, but my biggest concern here isn't fact that votes/ratings can be fake. I know that there is no possibility to get real user identification and to prevent malicious users to do they job, without registering(but, as i said, there is no registration/login, everyone can vote). I am concerned about script/server(s) possible overloading with some of mentioned ways of storing/retrieving data... @MattDunbar, yes, even i am not using static ip, and also, proxies are here, so... Your suggested way is actually 3. way i described. My biggest concern here is number of rows which could be (possibly) created, and how many mySQL db can stand. Performances of scripts, if number of users/raters be dramatically increased? Quote Link to comment https://forums.phpfreaks.com/topic/104642-how-to-prevent-multiple-votingratinghotornot-clone/#findComment-535631 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.