Skip to content

Instantly share code, notes, and snippets.

@robtuley
Created December 30, 2014 17:40
Show Gist options
  • Save robtuley/ac9538d206405aca5521 to your computer and use it in GitHub Desktop.
Save robtuley/ac9538d206405aca5521 to your computer and use it in GitHub Desktop.
<?php
session_start();
$ans = $_POST['captcha']; // .. or whatever!
$checksum = md5(strtolower(trim($ans)));
if (in_array($checksum,$_SESSION['captcha_ans'])) {
// passed..!
} else {
// error: redisplay form, etc.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment