Hi,

I wrote function like dis..
--------------------------------------------------------------------------------------------------------------------------------------------------------
 class QuickPostsController extends AppController{
    var $components = array('Captcha');
    var $helpers = array('Session','Captcha');

    function captcha() {
        $this->Captcha->show();
        $this->Captcha->filter = array('blur' => 1, 'noise' => 5);
        $this->Captcha->case = true;
    }

   function register()
    {
        if (!empty($this->data) && $this->Captcha->protect()) {
            //unset( $this->data['Captcha/captcha']);

            $this->QuickPost->create();
            if($this->QuickPost->saveAll($this->data)){
                $this->Session->setFlash('Quick Post Added Successfully
='.$this->data['Captcha/captcha']);
                $this->redirect(array('action'=>'../users/login'));
            }
        } else {
            $this->Session->setFlash('captcha verification failed
='.$this->data['Captcha/captcha']);
            $this->redirect(array('action'=>'../users/login'));
        }
    }
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
If i run dis.. it goes to else part i.e; "captcha verification failed "
eventhough the entered string is proper..
If anything wrong in this code.. please let me know..

Thanks,
Vidya

On Mon, Nov 30, 2009 at 6:53 PM, jburns <[email protected]> wrote:

> I have had a quick scan through the code (I haven't used this before)
> and it appears it is this line that does the validation:
>
>  function add() {
>    if (!empty($this->data) && $this->Captcha->protect()) {
>     $this->ModelName->save($this->data);
>     }
>  }
>
> On Nov 30, 1:16 pm, Vidya N <[email protected]> wrote:
> > Thanks for your reply now I am getting.. captcha image...
> >
> > but how to check after submitting form whether the entered captcha is
> > correct?.....
> >
> > Thanks,
> > Vidya
> >
> >
> >
> > On Mon, Nov 30, 2009 at 6:42 PM, jburns <[email protected]> wrote:
> > > Make sure you have the line:
> >
> > > var $components = array('Captcha');
> > > var $helpers = array('Captcha');
> >
> > > ..in the controller that is calling the component.
> >
> > > As a general help point, if you click the "Notice (8)" link, you'll
> > > see a lot of useful information that can help track down an error.
> >
> > > On Nov 30, 7:40 am, Vidya N <[email protected]> wrote:
> > > > Hi, I am cakePHP learner..
> > > > I am making an simple application like Quick post of jobs & *in* this
> I
> > > want
> > > > to implement the *Captcha* *in* my form.For this I help from the link
> :
> > >http://bakery.
> *cakephp*.org/<goog_1259558951763>articles/view/improved-*
> > > > captcha* <goog_1259558951763>-component
> >
> > > > I have added captcha.php file to helper and to component as mentioned
> > > link
> > > > above link...
> >
> > > > but I am getting Problem like below if I run,
> >
> > > > *Notice* (8) <javascript:void(0);>: Undefined variable: captcha
> >
> > > > *Fatal error*: Call to a member function input() on a non-object.
> >
> > > > Please anybody help me to sort out this..
> >
> > > > Thanks & Regards,
> > > > Vidya
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "CakePHP" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<cake-php%[email protected]>
> <cake-php%[email protected] om>For more options, visit this
> group at
> > >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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

Reply via email to