Location: PHPKode > scripts > AbsCaptcha > abscaptcha/example_1.php
<?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 :: using the default settings
	$c = new Captcha('x_session_captcha', $dir, 'my_captcha_image');

// 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();
?>
Return current item: AbsCaptcha