Location: PHPKode > scripts > Very Simple Captcha > very-simple-captcha/demo.php
<?php
// Session start must be the first line, whether you include it or not :)
session_start();

if(empty($_POST)) {
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
CAPTCHA Code: <img src="captcha.php" border="0" alt="CAPTCHA!" id="captcha" onclick="this.src='captcha.php?'+Math.random();"> (<a onclick="document.getElementById('captcha').src='captcha.php?'+Math.random();">Click here if you can't read the code above!</a>)
<br />
Enter CAPTCHA: <input type="text" name="key" value="" />
<br /><br />
<input type="submit" value=" Verify Captcha " />
</form>
<?php
} else {
  if($_POST['key'] == $_SESSION['key']) {
    // Do stuff here
  } else {
    // Wrong captcha code
  }
}
?>
Return current item: Very Simple Captcha