<?php
class Captcha {

  //---[CZ]: vytvoříme hash
  public function create() {
  
    if (!isset($_POST["hash"])) { $_POST["hash"]=""; }
    if (!isset($_POST["check"])) { $_POST["check"]=""; }
    
    $check1=sha1(mt_rand(0, 1000000));
    $check2=sha1(time());
    $check=substr($check1, 1, 15)."".substr($check2, 1, 15);
    $check=substr($check, 1,5);
    echo "<table style=\"margin: 0px;\"><tr><td style=\"width: 20%;\"><img src=\"/components/pages_index/captcha.php?hash=$check\" alt=\"CAPTCHA\" /><input type=\"hidden\" name=\"hash\" value=\"$check\" /></td><td><input type=\"text\" name=\"check\" size=\"6\" /></td></tr></table>";
    
  }

}
?>