Details
-
Type:
Docs: Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7.2
-
Fix Version/s: 1.8.4
-
Component/s: Zend_Captcha
-
Labels:None
-
Language:English
Description
It is not very clear from the Zend_Captcha documentation exactly how to validate submitted CAPTCHAs when using Zend_Captcha as a standalone component (i.e. without Zend_Form).
The code example on: http://framework.zend.com/manual/en/zend.captcha.operation.html shows the following:
// On subsequent request: // Assume captcha setup as before, and $value is the submitted value: if ($captcha->isValid($_POST['foo'], $_POST)) { // Validated! }
Without delving into the source code users have no way of knowing that $_POST['foo'] should be a key/value array containing the keys id (id of the generated captcha), and input (the string the user entered into a form). The comment also references the variable $value, which is never set or used (I believe this is leftover from before the 1.7 changes made as a result of issue #ZF-3995)
It would be useful if this example was extended to be a working example that included a basic HTML form showing the markup required.
Here's a working example based on the one currently in the docs.