<?php
/**
* TEST CAPTCHA CLASS
*/
# No cache headers
header("Expires: Mon, 05 June 2001 05:06:07 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
session_start(); # REQUIRED
// INCLUDE THE CAPTCHA CLASS
require("class.AbsCaptcha.php");
// SET THE PATH TO THE DIRECTORY WHERE TO STORE THE IMAGE
$dir = $_SERVER['DOCUMENT_ROOT'].'/Projects/Captcha/captcha/';
// INSTANTIATE THE CLASS :: change the background and the foreground color
$c = new AbsCaptcha('x_session_captcha', $dir, 'captcha', array(0,0,0), array(255,255,255));
// GENERATE IMAGE
$c->GenerateCaptcha();
// DISPLAY THE IMAGE
echo '<img src="captcha/'.$c->GetImageName().'" width="'.$c->GetImageWidth().'" height="'.$c->GetImageHeight().'" />';
// DISPLAY THE CODE FROM THE IMAGE
echo '<p>code: '.$c->GetCaptchaCode().'</p>';
// uncomment to clear the session.
// session_destroy();
?>
|