Integrating Google Captcha
I've usually written my own code for captcha and bot intervention, but google is making it very easy now.
Google's own documentation - Just click on "My reCAPTCHA" to create one.
Client-side HTML
Inside HEAD: <script src='https://www.google.com/recaptcha/api.js'></script> Inside FORM (method POST): <div class="g-recaptcha" data-sitekey="YOUR-KEY"></div>
Server-side PHP (POST action)
// Sjekk captcha først. isset($_POST['g-recaptcha-response'])) { $google_captcha_response = file_get_contents( "https://www.google.com/recaptcha/api/siteverify". "?secret=YOUR-KEY". "&response=". $_POST['g-recaptcha-response'] . "&remoteip=". $_SERVER['REMOTE_ADDR'] ); $success_result = json_decode($google_captcha_response, true); if ($success_result['success'] != true) exit('Confirm that you\'re not a robot... <a href="javascript:history.back()">Try again</a>'); // Human verified, continue... }