Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /**
  2.    * Validate the code entered by the user.
  3.    *
  4.    * <code>
  5.    *   $code = $_POST['code'];
  6.    *   if ($securimage->check($code) == false) {
  7.    *     die("Sorry, the code entered did not match.");
  8.    *   } else {
  9.    *     $valid = true;
  10.    *   }
  11.    * </code>
  12.    * @param string $code  The code the user entered
  13.    * @return boolean  true if the code was correct, false if not
  14.    */
  15.  
  16.  
  17.  
  18. session_start();
  19.  
  20. include '../Security/SecurImage.php';
  21. $_POST["dontRefresh"] = true;
  22. $securimage = new Securimage();
  23. if($securimage->check($_POST['code'])){
  24.     echo 'true';
  25. } else {
  26.     echo 'false';
  27. }