<!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>
|