Login   Register  
PHP Classes
elePHPant
Icontem

File: test_pictcapt.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Patricio Cardó  >  Pict CAPTCHA  >  test_pictcapt.php  >  Download  
File: test_pictcapt.php
Role: Example script
Content type: text/plain
Description: example and test
Class: Pict CAPTCHA
CAPTCHA validation making the user select pictures
Author: By
Last change:
Date: 1 year ago
Size: 1,106 bytes
 

Contents

Class file image Download
<?php
require_once("pictcaptcha.php");
session_start();
$alerta "";
$capt_conf = array(
        
"quantity"=>3,
        
"linker"=>"pictcaptcha_link.php",
        
"phrases"=> array("help"=>"ayuda""reload"=>"recargar dibujo")
    );
$capt = new pict_captcha($capt_conf);

if(!empty(
$_POST["pictcapt_id"])){
    
$exito = ($capt->verify())?"Bien":"Mal";
    
$alerta .= "<div style='width:400px;background-color:#ffffdd;font-family:Arial'>".$exito."</div>";
}
$ifr $capt->gethtml();

?>
<!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' xml:lang='es' lang='es' >
<head>
    <meta http-equiv='content-type' content='text/html; charset=UTF-8' />
</head>
<body>
<?php
print $alerta;
print 
"<h1>Testing pict_captcha</h1>
    <form action='"
.$_SERVER["PHP_SELF"]."'    method='post'>
    <table><tbody><tr>
        <td>Select the images represented in the drawing</td>
        <td style='background-color:#eeeeee'>
$ifr</td>
    </tr></tbody></table>
    <input type='submit' name='captcha'/>
    </form>
    <br/>"
;
//session_unset();
?>
</body></html>