recaptcha

<script>
        grecaptcha.ready(function() {
          grecaptcha.execute('SITEKEY', {action: 'submit'}).then(function(token) {
              document.getElementById("token").value = token;
          });
        });
  </script>

3.88
8
Lexy 115 points

                                    This package is abandoned. The sad fact is that I don't have time to maintain 
this package, so the release of Laravel 6 is as good as any to make a clean 
break. 

Alternative : https://github.com/biscolab/laravel-recaptcha

3.88 (8 Votes)
0
4
4
EndGamer 110 points

                                    //using curl recaptcha v3 (sajo sunny) 
//add elements using html
(don't add elements to dom using script)


https://code.tutsplus.com/tutorials/example-of-how-to-add-google-recaptcha-v3-to-a-php-form--cms-33752

4 (4 Votes)
0
4.3
10

                                    What is reCAPTCHA? reCAPTCHA protects your website from fraud and abuse. reCAPTCHA uses an advanced risk analysis engine and adaptive challenges to keep malicious software from engaging in abusive activities on your website.

4.3 (10 Votes)
0
4.44
10

                                    &lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
    &lt;script src=&quot;https://www.google.com/recaptcha/api.js?render=SITEKEY&quot;&gt;&lt;/script&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Document&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form method=&quot;post&quot; action=&quot;&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;token&quot; id=&quot;token&quot;&gt;
        &lt;button type=&quot;submit&quot; name=&quot;submit&quot;&gt;Send&lt;/button&gt;
    &lt;/form&gt;
        &lt;script&gt;
        grecaptcha.ready(function() {
          grecaptcha.execute('SITEKEY', {action: 'submit'}).then(function(token) {
              document.getElementById(&quot;token&quot;).value = token;
          });
        });
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php 

  if(isset($_POST['submit'])){
    $request = file_get_contents(&quot;https://www.google.com/recaptcha/api/siteverify?secret=SECRETKEY&amp;response=&quot; . $_POST['token']);
    $request = json_decode($request);
    if($request-&gt;success == true){
      if($request-&gt;score &gt;= 0.6){
        // Do something
      }else{
        echo &quot;error&quot;;
      }
    }
  }
?&gt;

4.44 (9 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source