Hi guys,
Having finally chosen one form to go with, I'm having some issues still... I went to Securimage.com to install captcha into my form.htm and gdform.php. The Captcha comes up just fine, refreshes the catpcha image without having to reload the page, and everything seems to be working fine, but even if you put in the wrong Captcha information, it sends it through no problem. I figure I put the code for Captcha to check that the input was correct wrong in the gdform.php file...
<?php session_start(); ?>
<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET")
{
$query_vars = $_GET;
}
elseif ($request_method == "POST")
{
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");
$file = $_SERVER['DOCUMENT_ROOT'] . "\ssfm\gdform_" . $t;
$fp = fopen($file,"w");
while (list ($key, $val) = each ($query_vars))
{
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\r\n");
fputs($fp,"$val\r\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\r\n");
if ($key == "redirect")
{
$landing_page = $val;
}
}
fclose($fp);
if ($landing_page != "")
{
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
}
else
{
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_GET['captcha_code']) == false) {
// the code was incorrect
// handle the error accordingly with your other error checking
// or you can do something really basic like this
die('The code you entered was incorrect. Go back and try again.');
}
?>
I thought I followed the directions from this site correctly, but I'm figuring somewhere at the bottom of the code starting with "include_once $_SERVER...." is where I put the code in improperly. This page is where my form and captcha image are. If someone could to please take a look and point out what I'm doing wrong, I'd greatly appreciate it. If you go to the page with the form, ignore the other content, just place holders until I get the form working properly . In my emails, I do see what Captcha information they entered, if any at all, but it's just not stopping them from submitting if they entered incorrectly.
Thanks,
Chance