Skip to content

Instantly share code, notes, and snippets.

@jasonsarino
Created July 16, 2015 10:52
Show Gist options
  • Save jasonsarino/7687082d449ccb2f4618 to your computer and use it in GitHub Desktop.
Save jasonsarino/7687082d449ccb2f4618 to your computer and use it in GitHub Desktop.
Google multi-reCaptcha
<div id="reCaptcha1"></div>
<div id="reCaptcha2"></div>
<?php if($page == "contact" || $page == "request-a-quote" || $page == "request-a-call-back" || $page == "comdata-demo") {
?>
<script type="text/javascript">
var CaptchaCallback = function(){
grecaptcha.render('reCaptcha1', {'sitekey' : '<?php echo SITE_KEY;?>'});
grecaptcha.render('reCaptcha2', {'sitekey' : '<?php echo SITE_KEY;?>'});
};
</script>
<?php }else{?>
<script type="text/javascript">
var CaptchaCallback = function(){
grecaptcha.render('reCaptcha1', {'sitekey' : '<?php echo SITE_KEY;?>'});
};
</script>
<?php }?>
<script src="//www.google.com/recaptcha/api.js?onload=CaptchaCallback&render=explicit&hl=en" async defer></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment