PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of chema garrido   UL CAPTCHA   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: UL CAPTCHA
Generate images for CAPTCHA validation
Author: By
Last change: new example to create the tag
Date: 12 years ago
Size: 766 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML>
<html>
<body>

<?php
session_start
();
require_once(
'captcha.php');


if (
$_POST)
{

    if (
captcha::check_CSRF('contact'))
    {
        if(
captcha::check('contact'))
        {
           
//correct captcha!
           
echo 'correct captcha! <br>';
           
var_dump($_POST);
        }
        else echo
"Wrong captcha";
    }
    else echo
"Wrong referer CSRF";
}

?>
<form method="post" action="" >
Name:<br />
<input id="name" name="name" type="text" value="<?php echo $_POST['name'];?>" maxlength="75" /><br />

    Captcha*:<br />
     Captcha*:<br />
    <?php echo captcha::image_tag('contact');?><br />
    <input id="captcha" name="captcha" type="text" />

<br />
<br />
<?php echo captcha::CSRF('contact');?>
<input type="submit" />
</form>

</body>
</html>