Preventing Spam

前端 未结 6 1735
故里飘歌
故里飘歌 2020-12-29 00:28

How do you stop bots on a page which is accessible to registered users only? 90% page is accessed by real users and 10% are bot.

I do not want to put captcha or veri

6条回答
  •  执笔经年
    2020-12-29 01:11

    One trick I like to use is to add a hidden input field to my forms that a real user would never see or change, but that a bot would blindly fill out.

    Something like

    
    

    and then, in your form handling code, make sure the value of spam_stopper is "DO NOT CHANGE THIS".

    A smart bot may ignore display:none, but that's not too likely - many do ignore though, so I wouldn't use that...

提交回复
热议问题