Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email 从表单提交中排除特定电子邮件地址_Email_Block_Spam Prevention - Fatal编程技术网

Email 从表单提交中排除特定电子邮件地址

Email 从表单提交中排除特定电子邮件地址,email,block,spam-prevention,Email,Block,Spam Prevention,我对PHP完全陌生,我只是想在我的表单中阻止垃圾邮件。我有 通过以下代码了解了如何创建蜜罐(url字段) 阻止90%的垃圾邮件,但这一个恼人的电子邮件通过 (我们叫他们redacted@example.com)。我想写一行 我表单中的代码,只说明电子邮件字段是否填写了文本 'redacted@example.com“,则不要传递表单。有人能帮我做这件事吗 // if the url field is empty // if(isset($_POST['url']) && $_PO

我对PHP完全陌生,我只是想在我的表单中阻止垃圾邮件。我有 通过以下代码了解了如何创建蜜罐(url字段) 阻止90%的垃圾邮件,但这一个恼人的电子邮件通过 (我们叫他们
redacted@example.com
)。我想写一行 我表单中的代码,只说明电子邮件字段是否填写了文本
'redacted@example.com“
,则不要传递表单。有人能帮我做这件事吗

// if the url field is empty
// if(isset($_POST['url']) && $_POST['url'] == ''){

// then send the form to your email
// mail( 'myemail@me.com', 'Contact Form', print_r($_POST,true) );
// }

// otherwise, let the spammer think that they got their message through
使用此代码

if(isset($_POST['url']) && $_POST['url'] == '') {
    if ($_POST['email'] != 'dukang2004@yahoo.com') {
        // then send the form to your email
         mail( 'myemail@me.com', 'Contact Form', print_r($_POST,true) );
    }
}
使用此代码

if(isset($_POST['url']) && $_POST['url'] == '') {
    if ($_POST['email'] != 'dukang2004@yahoo.com') {
        // then send the form to your email
         mail( 'myemail@me.com', 'Contact Form', print_r($_POST,true) );
    }
}

如果它对你有效,那么一定要接受答案,这样它就不会出现在未回答的答案下面。它有效!!我觉得这样问很傻……这是我第一次在这个论坛上发帖。我如何接受答案?如果它对你有效,那么一定要接受答案,这样它就不会出现在未回答的答案下。它有效!!我觉得这样问很傻……这是我第一次在这个论坛上发帖。我如何接受这个答案?