When the captcha image is generated, it writes the value to a $_SESSION variable for later comparison with the user’s input. When the second one is drawn, it overwrites the variable.
You’d need to hack eForm and jot to send the name of the session variable (different for each snippet call) as a parameter to the constructor in veriword.php. Then hack veriword.php to accept and use that session variable. You’d also have to hack the validation code so it used the right one (and maybe send the name of the variable in the POST).
There may be a simpler way, but that’s the best I can come up with off the top of my head.
There’s another way I thought of, though it’s kind of inefficient. You could make a second copy of eForm, Jot and Veriword.php with different names (eForm2, etc.).
Then change jot2 and eForm2 to use veriword2.php , and change veriword2.php to use a different name for the $_SESSION variable, and change eForm2 and jot2 to check *that* varable in their validation.
That way you’d be calling two different snippets on the same page and they wouldn’t conflict.
OTOH, you can tell your client that CAPTCHA is no longer effective because there are a number of bots now that can read CAPTCHA images.
As an alternative, you might look at the js code in SPForm that requires the user to use a mouse and/or keyboard for their input. I think it would be much more effective than CAPTCHA.
-
☆ A M B ☆
- 24,524 Posts
Hm.... it adds a hidden field. Won’t eForm get semi-hysterical about that?