G'day,
I'm trying to implement a CAPTCHA field into my existing form, with limited success so far.
I've been able to get it to tell me that the code is wrong. I've also been able to get it to tell me I'm right, but when I need to process the form into a database...that's where it fails.
If someone could take a look at the code that'd be bloody unreal.
<?php
session_start();
require("../africaforms/global/library.php");
if( isset($_POST['submit'])) {
if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {
letsgo();
unset($_SESSION['security_code']);
} else {
echo 'WRONG!';
}
} else {
function letsgo()
{
// check we're receiving something
if (empty($_POST))
ft_output_message("no_post_vars");
// check there's a form ID included
else if (empty($_POST['form_tools_form_id']))
ft_output_message("no_form_id");
// is this an initialization submission?
else if (isset($_POST['form_tools_initialize_form']))
ft_initialize_form();
// otherwise, it's a regular form submission. Process it.
else
process_form();
}
//the rest of the form [process_form();]
?>
<?php
}
?>