Why is my PHP E-mail form attracting spam?

吃可爱长大的小学妹 提交于 2019-12-03 21:55:18

There is a simple way to get rid of most spammers:

output an input field inside your form that as display: none; as a style. Ideally that is specified in an external css file.

Put that input field inside your form and give it an important name, like "name2" or something.

Then, when eveluating input, discard all requests that have avalue inside that field, as a real user can not see and and thus can't enter a value. Whereas spam bots most likely fill all fields they find on a page.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!