Location: PHPKode > scripts > CAPTCHA by Anchal > captcha-by-anchal/example.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<TITLE>Captcha Class </TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

	//Initialize the captcha object with our configuration options
	$captcha =& new captcha($CAPTCHA_CONFIG);
	if (isset($_POST['image'])) {
			// form was submitted with incorrect key
			case 0:
				echo "<script>alert('Invalid Code');</script>";
				echo '<p><br>Sorry. Your code was incorrect.';
				echo '<br><br><a href="'.$_SERVER['PHP_SELF'].'">Try AGAIN</a></p>';

			// form was submitted and has valid key
			case 1:
				echo '<p><br>Congratulations. You will get the resource now.';
				echo '<br><br><a href="'.$_SERVER['PHP_SELF'].'">Test Again</a></p>';
	else {
	$imgLoc = $captcha->create_captcha();
	<img src="<?php echo $imgLoc;?>" alt="This is a captcha-picture. It is used to prevent mass-access by robots." title=""><br>
	<form name="captcha" action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
	<input type="hidden" name="image" value="<?php echo $imgLoc;?>">
	<input type="text" name="attempt" id="attempt" value="" size="20"><br>
	<input type="submit" value="Submit">
Return current item: CAPTCHA by Anchal