So I have a Captcha Script Running on my registration page. It successfully produces the image, and works fine it's just that you can type anything and it will work.
I thought it could be the session variable that is equal to the code in the image wasn't valid, or was nothing, but it appears to be my text form.
After isset() tests to see if my form is submitted, I check to see if my text field named 'imageCode' was empty or not. If it is empty I post an error as I do with every empty field. It will simply not read the text box or even seem to know it exists.
Here is the code of that part of the form, and validation code.
$errors = 0;
if (isset($_POST['registerForm']))
{
$imageCode = $_POST['imageCode'];
if(($imageCode == "") || (empty($_POST['imageCode'])))
{ $errors = 1;
$error .= "* Your text does not match the text in the image *<br>";
}
}
It doesn't come up as an error if nothing is entered, and all my other fields are recognized as errors.
<form action="" name="registerForm" method="POST">
<input type="text" size="10" name="imageCode">
<input type="submit" name="registerForm">
</form>
If anyone could help me it would be a great help! Thanks.