PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Er. Rochak Chauhan   iCaptcha   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: iCaptcha
CAPTCHA validation asking questions about pictures
Author: By
Last change:
Date: 16 years ago
Size: 766 bytes
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>iCaptcha :: by Rochak Chauhan</title>
</head>
<body>
<form action="index.php" method="post">
<table>
<?php
//display iCaptcha

require_once("iCaptcha.inc.php");
$iCaptcha = new iCaptcha();
echo
$iCaptchaInfo=$iCaptcha->showICaptcha(true);
?>
<tr>
<td align="center" colspan="6"><input type="submit" name="submit" value="Submit Form"/></td>
</tr>
</table>
</form>
</body>
</html>
<?php
//validate iCaptca
if(isset($_POST['submit'])) {
    require_once(
"iCaptcha.inc.php");
   
$iCaptcha = new iCaptcha();
   
    if(
$iCaptcha->validateICaptcha($_POST['captchaId'], $_POST['icaptcha'])){
        die(
"YES");
    }
    else {
        die(
"NO");
    }
}
?>