简体   繁体   English

在PHP中保护Mailto链接免受垃圾邮件的好方法

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

I'm working on a WordPress theme; 我正在研究WordPress主题; the user can enter their emailaddress so it creates a mailto: link. 用户可以输入其电子邮件地址,以便创建mailto:链接。 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). 现在,我想我会引起很多人说“使用搜索引擎”, 我尝试了,然后尝试了 ,而且您猜到了, 我尝试了 (在上一次搜索中,我获得了JavaScript而不是PHP)。

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? 有什么好的方法来保护完整的yourmail@business.com (完整的yourmail@business.comyourmail@business.com )免受PHP的垃圾邮件yourmail@business.com 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. 如果您不想干扰用户的体验,则可以创建一个不可见的表单,该表单将在您单击真实按钮时(而不是在僵尸程序试图向其发送垃圾邮件时)从后端填充。 ,某种SQL注入。 Finally, you should just send the mail when the invisible form gets the server filled. 最后,您应该只在看不见的表格填满服务器时发送邮件。 That's the main idea 那是主要思想

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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