1

The front end of reCaptcha seems to work fine. It will time out and will even challenge you. The reCaptcha Admin panel says it is working and the chart shows a bunch of fails, BUT spam keeps coming through. I am assuming it must be the validation that fails. But why? What is wrong with this code that spam keeps on getting through?

if(isset($_POST['submit'])){ 
    if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){ 
         
        $verify_captcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret_key.'&response='.$_POST['g-recaptcha-response']); 
        $verify_response = json_decode($verify_captcha); 
         
        if($verify_response->success){ 
            $returnMsg = 'Your email has been submitted successfully.'; 

            include ('./includes/sendmail.php');
            include ('./forms/sectionhead.tpl');  
            echo "<p class='returnmsg'>reCAPTCHA was completed successfully!<br> $returnMsg</p>";   
            //echo $returnMsg;
            echo "
                <div class=\"bg-theme-colored\" style=\";color:#754c00;border:1px solid #11477f;text-align:center;padding:25px;\">
                <h4><span>Success!</span> Your message has been sent.</h4>
                <h5>A copy of your message has been emailed to $_POST[form_email]</h5> 
                <h5>Thank you for your interest in the North American Bison </h5>
                </div>";
            include ('./forms/contactend.php');
            exit();  
                         
        }else{ 
            $returnMsg = 'reCaptch verification failed, please verify again.';
            include ('./forms/sectionhead.tpl');  
            echo '<p class="returnmsg">reCAPTCHA error: ' . $returnMsg . '</p>';
            include ('./forms/contactform.php'); 
            include ('./forms/contactend.php');
            exit();
        } 
    }else{ 
  $returnMsg = 'Please check the CAPTCHA box.'; 
        
        include ('./forms/sectionhead.tpl');  
        echo '<p class="returnmsg">reCAPTCHA error: ' . $returnMsg . '</p>';
        include ('./forms/contactform.php'); 
        include ('./forms/contactend.php');
        exit();
    } 
}

Since you may ask something like are you sure it is SPAM, here is an example or 2:

Name: ApkJoysuevy Email: allisonharry683@gmail.com City: Moscow State: AL

Message: You can download any of the provided casinos above without any problems. If you download the casino app, it will position like a regular mirror image of the power supply place from the mobile version. Unfortunately, all the apps you download choose however do one's daily dozen on Android. Download casino in 1 click from the tabulate, these are the most advanced transportable applications. The best casino apps for Android The problem is that declaration Android apps and downloading them can be iffy, as Google doesn't authorize legitimate folding money Android casinos to be placed in the Flirt Store. Download casino app But don't worry .... etc

Name: PirikusMeste Email: prikus@draviero.xyz City: Ekaterinburg State: BC

Message: Ñ‚Ñ€Ð¾Ð¸Ñ†ÐºÐ°Ñ Ð¿Ñ€Ñжа интернет

Any thoughts appreciated cause I am at a loss

Rod
  • 33
  • 5

0 Answers0