Login   Register  
PHP Classes
elePHPant
Icontem

File: gd_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michael Rose  >  GD Image Verification Class  >  gd_example.php  >  Download  
File: gd_example.php
Role: Example script
Content type: text/plain
Description: Example file #2
Class: GD Image Verification Class
Generate CAPTCHA verification images for forms
Author: By
Last change: Changed content type
Date: 2005-12-01 19:18
Size: 1,101 bytes
 

Contents

Class file image Download
<?php
// Velox Letum (2005)
// elementation@gmail.com
// http://www.nanoshock.net

// Require the class code...
require ('gd_image_verify.php');

// Initialize class
$gd = new gd_verification();

if (isset(
$_POST['submit'])) {
    if (
$gd->verify_string($_POST['gd_string'])) {
        
$result 'User input matches image string.';
    } else {
        
$result 'User input does not match image string.';
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>GD Image Verification Class Example</title>
<head>
<body>
    <div style="text-align:center;">
        <h1>GD Image Verification Class Example</h1>
        <? echo $result?><br /><br />
        <form name="gd_verify" method="POST" action="<? echo $PHP_SELF?>">
            <img src="gd_image.php" alt="Verification Image" /><br /><br />
            <? echo $gd->output_input_box('gd_string'); ?><br /><br .>
            <input type="submit" name="submit" value="Submit" />
        </form>
    </div>
</body>
</html>