防止客户对产品多次评分的最佳方法是什么?

发布于 2024-08-22 05:29:12 字数 98 浏览 4 评论 0原文

如何防止客户多次对产品进行评分?最好使用存储 IP 地址的 cookie,还是最好将用户评级存储在数据库中?我正在使用 MySQL 和 ColdFusion。

干杯!

How do I prevent a customer from rating a product more than once? Is it best to use cookies that store the IP address or is it best to store user ratings in the database? I am using MySQL and ColdFusion.

Cheers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

奶气 2024-08-29 05:29:12

如果您有用户帐户,请将您的评级与帐户相关联。只要一个用户只有一个帐户就可以完成工作。

如果您使用cookie,那么您可能会遇到禁用cookie、使用多个浏览器或故意删除cookie的用户的问题,如果您存储IP地址,您可能会遇到(尽管这种情况很不寻常)不同用户的问题来自同一 IP 地址 - 同一家庭或组织可能拥有相对较少的外部 IP 地址,而 AOL 等 ISP 通常会收到来自多个 IP 的单个页面请求。

总的来说,我的感觉是,如果用户足够关心对产品进行评分,他们可能会足够关心注册用户帐户。您仍然可以密切关注 IP 数据和其他浏览器信息,以防出现任何可疑情况,但这是确保您的用户至少足够独特以拥有不同电子邮件地址的最有效方法。它不会抓住任何想要认真操纵你的评分的人,但实际上,如果你确实遇到这样的人,无论你做什么,你都很难阻止他们,直到你有了指示性的使用模式,你将很难知道他们做了什么寻找。在这种情况下,确保无论你做什么,都仔细记录日志很重要......

If you have user accounts, associate your ratings with the accounts. Job done as long as one user only has one account.

If you use cookies then you will likely run into problems with users who have them disabled, who use multiple browsers or who deliberately delete them, if you store the IP address you will potentially ( although it is quite unusual ) run into problems with different users from the same IP address- the same family or organisation will probably have relatively few external IP addresses, while ISPs such as AOL will routinely have requests for a single page come from multiple IPs.

On the whole my feeling is that if a user cares enough to rate a product they probably care enough to sign up for a user account. You can still keep an eye on IP data and other browser information in case anything dodgy is going on, but that is the most effective way to ensure that your users are at least distinct enough to have different email addresses. It won't catch anyone wanting to seriously manipulate your ratings, but actually if you do run into someone like that you will have a hard time stopping them whatever you do and until you have indicative useage patterns you'll be hard pressed to know what to look for. In this instance making sure that whatever you do, you keep careful logs is important...

水波映月 2024-08-29 05:29:12

如果您可以将评级存储在数据库中,那就去做吧。 Cookie 可以被删除,IP 地址也无法用于可靠地识别特定人员。

If you can store the ratings in the database, go for it. Cookies can be deleted and IP addresses can't be used to reliably identify a particular person.

情栀口红 2024-08-29 05:29:12

那么,一旦评级,您的所有评级程序都会与数据库通信,对吧?由于您使用的是 mySQL,每个评级可能都会保存在您的数据库中。

当您对产品进行评级时,只需根据用户的 IP 或用户名(如果适用)为用户提供一个唯一的 ID。然后检查该用户之前是否已经评分过一次。

这很简单。

 IF userVoted != true 
         saveVote ( "ipAddress", "User Voted Yes")
    else
         display ( "You have already voted" )

Well, all of your rating proceedures once rated will communicate with a database right? Since you are using mySQL each rating will presumably be saved in your database.

When you have rated a product, just give the user a unique ID, based on his IP, or if applicable a username. Then check to see if this user has already rated once before.

Its quite simple.

 IF userVoted != true 
         saveVote ( "ipAddress", "User Voted Yes")
    else
         display ( "You have already voted" )
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文