0 && strlen($_SESSION["phrase"]) > 0 && $_POST["phrase"] == $_SESSION["phrase"]) { $msg = "OK!"; $ok = true; } else { $msg = "Please try again!"; } unlink(session_id() . ".png"); } print "
$msg
"; if (!$ok) { require_once 'Text/CAPTCHA.php'; //require_once 'CAPTCHA.php'; // Generate a new Text_CAPTCHA object, Image driver $c = Text_CAPTCHA::factory('Image'); $c->init(200, 80); // Get CAPTCHA secret passphrase $_SESSION["phrase"] = $c->getPhrase(); // Get CAPTCHA image (as PNG) file_put_contents(session_id() . ".png", $c->getCAPTCHAAsPNG()); echo ""; } ?>