芝麻web文件管理V1.00
编辑当前文件:/home/strato/chroot/opt/RZphp5/includes/doc/Text_CAPTCHA/examples/CAPTCHA_test_phraseoptions.php
0 && strlen($_SESSION['phrase']) > 0 && $_POST['phrase'] == $_SESSION['phrase']) { $msg = 'OK!'; $ok = true; unset($_SESSION['phrase']); } else { $msg = 'Please try again!'; } unlink(sha1(session_id()) . '.png'); } print "
$msg
"; if (!$ok) { require_once 'Text/CAPTCHA.php'; // Set CAPTCHA image options (font must exist!) $imageOptions = array( 'font_size' => 24, 'font_path' => './', 'font_file' => 'COUR.TTF', 'text_color' => '#DDFF99', 'lines_color' => '#CCEEDD', 'background_color' => '#555555' ); // Set CAPTCHA options $options = array( 'width' => 200, 'height' => 80, 'output' => 'png', 'imageOptions' => $imageOptions, 'phraseOptions' => array('unpronounceable', 'alphanumeric') ); // Generate a new Text_CAPTCHA object, Image driver $c = Text_CAPTCHA::factory('Image'); $retval = $c->init($options); if (PEAR::isError($retval)) { printf('Error initializing CAPTCHA: %s!', $retval->getMessage()); exit; } // Get CAPTCHA secret passphrase $_SESSION['phrase'] = $c->getPhrase(); // Get CAPTCHA image (as PNG) $png = $c->getCAPTCHA(); if (PEAR::isError($png)) { printf('Error generating CAPTCHA: %s!', $png->getMessage()); exit; } file_put_contents(sha1(session_id()) . '.png', $png); echo '
' . '
' . '
' . '
'; } ?>