1

I do not know whats wrong with my code, I am using code igniter framework and I have implemented recaptcha like so:

In the view: <div class="g-recaptcha" data-sitekey="***********************************"></div>

In the submitted form response page:

if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response']))
                {
                        $secret = '???*******************************??????';
                        $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
                        $responseData = json_decode($verifyResponse);
                        if($responseData->success)
                        {
                            $succMsg = 'Your registration request has submitted successfully.';
                        }
                        else
                        {
                            $this->session->set_flashdata('error_msg', 'CAPTCHA Verification Failed');
                            redirect('User/login_view');;
                        }
                }

Despite the implementation, I am getting upto 15 spam registrations per day. Any help?

Kwikfox
  • 21
  • 1
  • 3

1 Answers1

4

reCaptcha (and any other captcha) won't prevent spam, it will only prevent bots from using the form. There are captcha farms out there with real workers solving captchas. To prevent spam registrations, the captcha must be combined with other forms of validation such as one time passwords via SMS.

Enrico Dias
  • 1,417
  • 9
  • 21
  • 1
    The Spam looks like it is bot generated the characters are all out of whack! I agree that the OTP method is most effective though but my solution is at a non-profit stage so utilization of such resources will be too expensive. Thanks for the idea though! :) – Kwikfox Apr 29 '20 at 03:46
  • Bots can use captcha farms to fill the captcha. There are several services that provides free SMS, Firebase for example: https://firebase.google.com/pricing/ – Enrico Dias Apr 29 '20 at 04:01
  • Thanks Elias! I didnt know there were free options like firebase! This really helps! – Kwikfox Apr 29 '20 at 06:57
  • @Kwikfox you're welcome. If that solves your problem, can you mark the question as answered? – Enrico Dias Apr 29 '20 at 14:18
  • Yes this is answered – Kwikfox May 04 '20 at 01:03