Forum Moderators: coopster
I have a form, which when submitted, 'posts' the data to a cgi script (formmail) and then redirects the user to a thank-you page.
However, a php captcha seems to do everything within one php file - you hit submit and it reloads the php file while validating the captcha. Is there a way to get a script to validate the captcha and if valid, send the data to the cgi script and then redirect the user to the thank you page?
A thread that may be of interest to you: Combatting Web-Form Hijack [webmasterworld.com].
Here's the code on my form:
<?php
error_reporting(0);
require_once('b2evo_captcha.config.php');
require_once('b2evo_captcha.class.php');
$captcha =& new b2evo_captcha($CAPTCHA_CONFIG);
}
?>
<form action="submissiontest.php" method="POST" name="form" id="form" onsubmit="return validate_form(this); ">
<?=$captcha->Convert_Captcha();?>
<input type="hidden" name="hash" value="<?=$captcha->GetHash()?>">
<input type=text autocomplete="off" name=CaptchaStr value="" size=20>
<input type=submit value="Submit">
</form>
Then when I print $_POST['CaptchaStr'] on the submissiontest.php page, it comes out as a very long string of characters.
Does anyone know what I have to do?