简体   繁体   中英

A Good Way to Protect a Mailto Link From Spam in PHP

I'm working on a WordPress theme; the user can enter their emailaddress so it creates a mailto: link. But I want that link to be protected from any spambots.

Now, I think I will get many people saying "Use a search engine", I tried and I tried , and, you guessed it, I tried (I get JavaScript instead of PHP in the last search).

My question is; is there any good way to protect a complete emailaddress (a complete emailaddress is eg yourmail@business.com ) from spambots with PHP? I don't want my user to split their emailaddress (If I get an old lady as a customer, she probably doesn't understand how to split an emailaddress into two pieces).

I am looking forward for any ideas you may come up with!

In one way you can use a captcha test. If you don't want to interfere in users experience, you can create an invisible form that you'll fill from your back-end just when button has been clicked for real, and not when a bot is trying to spam with, for example, some kind of SQL injection. Finally, you should just send the mail when the invisible form gets the server filled. That's the main idea

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM