防止垃圾评论

发布于 2024-10-28 20:41:22 字数 145 浏览 4 评论 0原文

我有一个页面,登录用户可以在其中发表评论。我想阻止用户同时发表评论以防止垃圾邮件。为此,我希望评论之间有 30 秒的间隙(我应该在会话中存储时间吗?),如果用户在给定的 5 分钟内发布 10 条评论,则应启用 reCaptcha(并重置会话中的评论计数器) 。这个方法可以吗?

I have a page where logged users can post comments. I want to stop users to post the comments simultaneously to prevent the spam. For that purpose, I want a gap of 30 seconds between the comments (should i store the time in session ?), also if the user posts 10 comments in given 5 minutes, reCaptcha should be enabled (and reset the comment counter in session). Is this approach ok?

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

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

发布评论

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

评论(4

你是暖光i 2024-11-04 20:41:22

会议可能是个好主意。但是,我认为许多机器人不允许 cookie,因此不会遵循会话。

对于大多数垃圾邮件发送者来说,发布 10 条成功的评论就足够了 - 之后 reCaptcha 对于活跃的普通用户来说只是一种烦恼。

我强烈建议尝试 Akismet。对于垃圾评论来说,这是令人难以置信的好处。

Session might be good idea. However, I think many bots are not allowing cookies, and therefore sessions are not followed.

Posting 10 successful comments is enough for most spammers - after that reCaptcha is just annoyance for active normal users.

I strongly recommend trying Akismet. It's unbelievable good for comment spam.

旧竹 2024-11-04 20:41:22

好吧,我认为所有这些垃圾评论的答案是:FLASH 评论框
我的意思是验证码太烦人了......我永远不会在那里留下评论,你必须有这个验证码的东西。
我建议类似: flexi comments 或其他内容...

Well I think the answer to all those SPAM comments is: FLASH comment box
I mean captcha is simply annoying... I would never leave a comment there where you have to have this captcha thingie going.
I would suggest something like: flexi comments or something...

听不够的曲调 2024-11-04 20:41:22

存储“最后发布”时间以及最近 5 分钟内的数量不应该是一个坏主意,就好像您只能每 30 秒发布一次一样,10 分钟最多只能发布 20 个帖子。您确实可以将其存储为会话的一部分,因为无论如何都可以在登录时从数据库检索数据(以防会话中断)

Storing a "last posted" time, and number in the last 5 minutes shouldnt be such a bad idea, as if you can only post every 30 seconds, 10 minutes is only a maximum 20 posts away. You could indeed store that as part of the session, as the data is retrievable from the database on login anyway (in case of session break down)

御守 2024-11-04 20:41:22

您还应该确保在任何 html 锚标记上使用 rel="nofollow" 属性您允许最终用户提交自己的信息,以降低垃圾邮件的吸引力。 rel="nofollow" 告诉搜索引擎忽略该链接,因此不允许垃圾邮件发送者从您网站上的垃圾邮件评论链接中获取例如 Google 页面排名。

You should also make sure that you use the rel="nofollow" attribute on any html anchor tags that you allow end users to submit themselves in order to make spamming less attractive. rel="nofollow" tells search engines to ignore the link, and therefore doesn't allow the spammer to harvest e.g. google page rank from spam comment links on your site.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文