PHP Classes

File: testCaptcha.php

Recommend this page to a friend!
  Classes of Ver Pangonilo   Simple CAPTCHA   testCaptcha.php   Download  
File: testCaptcha.php
Role: Example script
Content type: text/plain
Description: Test Application for the Simple Captcha class
Class: Simple CAPTCHA
Generate and verify CAPTCHA validation images
Author: By
Last change:
Date: 17 years ago
Size: 2,114 bytes


Class file image Download

   Projectname: Simple CAPTCHA class
   Version: 0.1
   Author: Ver Pangonilo <>
   Last modified: 18 May 2006
   Copyright (C): 2006 Ver Pangonilo, All Rights Reserved

   * GNU General Public License (Version 2, June 1991)
   * This program is free software; you can redistribute
   * it and/or modify it under the terms of the GNU
   * General Public License as published by the Free
   * Software Foundation; either version 2 of the License,
   * or (at your option) any later version.
   * This program is distributed in the hope that it will
   * be useful, but WITHOUT ANY WARRANTY; without even the
   * implied warranty of MERCHANTABILITY or FITNESS FOR A
   * PARTICULAR PURPOSE. See the GNU General Public License
   * for more details.

   This is an application for the SimpleCaptcha Class in user forms.





    <title>Simple CAPTCHA Class Application</title>
if (!$_POST['code'])
<form id="demo" action="<?php echo $_SERVER['PHP_SELF']; ?>?goto=login" method="POST">

            <textarea name="message" cols="25" rows="5" id="message" ></textarea>
            Validation Code:
            <img src="./captcha.php" alt="CAPTCHA">
            <input type="text" name="code" size="30">
            <input type="submit" value="Go">

//Check if userinput and CAPTCHA Code are equal
if ($_SESSION['string'] == $_POST['code'])
'<script>alert("Correct Code.");history.go(-1);</script>';
'<script>alert("Incorrect Code.");history.go(-1);</script>';