Skip to content

Instantly share code, notes, and snippets.

@robtuley
Created December 30, 2014 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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