I was able to follow this guide from the bakery:
http://bakery.cakephp.org/articles/view/captcha-component-with-phpcaptcha
And was able to install it on my machine, although. Im having troubles
validating the captcha. I mean i don't know if its the right thing to
do.
Ok, so i can now see the image. Also added on the views (input field)
for userCode. Now, the validation.
Here goes..
Created my component
controllers/component/captcha.php
Added it to my controller
controllers/emails_controller.php
var $components = array('SwiftMailer','Captcha');
function captcha_image()
{
$this->Captcha->image();
}
function index()
{
// my post
...
$client_userCode = $this->data['Email']['userCode'];
if ($this->Captcha->check($this->data['Email']['userCode'])) {
...
} else {// else captcha
$this->flash('Error in captcha','/emails');
}
}
I was able to validate the user input by user, but when the error
kick's in. I can't go back to the form. And, is this the proper way to
validate?
if ($this->Captcha->check($this->data['Email']['userCode'])) {
...
} else {// else captcha
$this->flash('Error in captcha','/emails');
}
Please help! thanks.
Louie Miranda
http://www.axishift.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---