PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of José M. Carnero   Captchazo   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Image example
Class: Captchazo
Validate users with image or text based CAPTCHA
Author: By
Last change:
Date: 11 years ago
Size: 536 bytes
 

Contents

Class file image Download
<?php session_start(); ?>
<?php
include('class.captchazo.inc'); ?>
<?php
if(!empty($_POST['captchazo']) && $_SESSION['captchazo'] == $_POST['captchazo']) echo('Captcha verified');
elseif(isset(
$_POST['captchazo'])) echo('Captcha failed');
unset(
$_SESSION['captchazo']);
?>
<br/><br/>
<img src="sample_img.php" alt="captcha" />
<br/><br/>
<form method="post"><label for="captchazo">Write image text and submit</label>
<br/><input id="captchazo" type="text" name="captchazo" value="" />
<br/><input type="submit" value="Submit" /></form>