Skip to content

Instantly share code, notes, and snippets.

View andrebruton's full-sized avatar

Andre F Bruton andrebruton

View GitHub Profile
@amityweb
amityweb / google-recaptcha-v2-php-code
Last active June 7, 2024 10:27
Google ReCaptcha v2 PHP Code
// Add in to HTML where you want the box to be
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
<div class="captcha_wrapper">
<div class="g-recaptcha" data-sitekey="YOUR_PUBLIC_KEY"></div>
</div>
// Add into PHP validation to check the submitted captcha response is a success or fail
/* Google ReCaptcha Verification */
@umrysh
umrysh / mailgun-webhook.php
Created January 29, 2015 23:11
Very simple PHP webhook for Mailgun that emails you on errors.
<?php
$key = "<API Key>";
$from = "info@example.com";
$to = "dave@example.com";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if(isset($_POST['timestamp']) && isset($_POST['token']) && isset($_POST['signature']) && hash_hmac('sha256', $_POST['timestamp'] . $_POST['token'], $key) === $_POST['signature'])
{
if($_POST['event'] == 'complained') {