I have multiple forms on a page which seem to validate strangely or randomly.
- If I enter the first code correctly, the same form will validate correctly every time until the code is entered incorrectly. After this validation always fails until I click on the image to reload it, then it all starts fine.
- Regardless of the 1st form processed, any other form fails validation until the image is clicked to reload. Then it start passing as in point 1. But all other forms will fail.
Namespaces don't seem to help.
This is the view.php:
$captcha->setNamespace($bUID);
$captcha->display();
echo $form->text('code'.$bUID, $code);
This is the controller.php:
$captcha->setNamespace($_POST['buid']);
if (!$captcha->check('code')) {
array_push($this->form_errors, $this->error_code);
}
The $bUID is a unique form block number, that is each form field is unique.
Looks like even though each form is unique, the Securimage image is created one for all, not as one for each form. And the namespaces don't help for some reason.
Is there any way to create a captcha image with a unique code and path for each unique form? Or am I not using the namespaces correctly?
Thank you.
Try use also
image_id
option besidesnamespace
.Here code, which I use for multicaptcha purposes: