开发者

Store IP or set cookie for PHP POLL?

I would like to make a voting system for my site. I need to check whether开发者_开发知识库 a user has voted already. Do I need to store the IP of the user or do I need to store a cookie in the users computer, then make validation if the IP is already used for voting or a cookie is already stored to the user's computer.


Neither of those will give you a flawless script because the user can still clear the cookies or browser a proxy to revote. However I would use both cookies and ip-adress in case the user have a dynamic ip adress or clearing the cookies.


I would suggest do both, as an IP can change and a cookie can be deleted.

Also if you want more accuracy, you can use Flash's LocalSharedObjects also known as FlashCookies to store whether a person has already voted or not. Much less people could/would delete these on regular basis.


i think the best way is have a user registration system to store user information like polling and etc.then you can easily check that user voted already or no ? this way is more secure than others.but for other option that you can consider,you can store user's mac adress.the mac adress is better that ip and cookie.but storing all information help you to have a good vote system.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜