重定向为Spam_Bot不定向

时间:2019-05-29 17:51:29

标签: redirect spam-prevention honeypot

提交表单时,垃圾邮件漫游器无法重定向。相反,它给了我一个HTTP错误500,说“当前无法处理此请求。”

如果spam bot错误为false,则它允许表单提交和重定向,因此仅涉及第一次重定向的问题。

<?php
    $honeypot = FALSE;
    if (!empty($_REQUEST['contact_me_by_fax_only']) && (bool) 
    $_REQUEST['contact_me_by_fax_only'] == TRUE) {
        $honeypot = TRUE;
        log_spambot($_REQUEST);
        header('Location: http://www.(hidden).com?SpamBotFailure');
        exit;
    } else {
        if(isset($_POST['submit'])) {
            $name = $_POST['name'];
            $phone = $_POST['phone'];
            $address = $_POST['address'];
            $emailFrom = $_POST['email'];
            $service = $_POST['service'];
            $message = $_POST['message'];

            $mailTo = "(hidden)";
            $subject = $service." Request";
            $headers = "Request From: ".$emailFrom;
            $txt = "Name: ".$name."\n"."Phone: ".$phone."\n"."Address: 
                ".$address."\n"."Message: ".$message;

            mail($mailTo, $subject, $txt, $headers);
            header("Location: http://(hidden).com/submitted.php?Success");
        } 
    }
?>

试图获取失败的表单提交以重定向

header('Location: http://www.(hidden).com?SpamBotFailure');

0 个答案:

没有答案