Hi, this brings me in big trouble.
When I have to reload the form because of a form validation error, the captcha shows the same question, but the answer within the session is already renewed. I use a math captcha like 2+3=? When I open my form I see for example 2+3 on submit I have for instance an empty field, the form reloads, the question is still 2+3 but the session key is already new. So I never have the chance to enter a valid captcha code. What do I do now?? Please help!! On 10 Okt., 17:58, euromark <[email protected]> wrote: > in beforeRender() in your app controller > > also make sure $this->MathCaptcha is available! > > On 10 Okt., 17:54, "[email protected]" > > > > <[email protected]> wrote: > > If i understand correctly you want to set the variable so it is available > > to any view. > > You can put your code in the AppController.php to achieve just that. > > > -flosky > > >heohni<[email protected]> schrieb: > > > Hi, > > > I am working on my default.ctp, where I included an element with an > > contact form which is using acaptchacode. > > On every page, regardless where I am on my project, I can click on the > > header contact link and open a popup with my contact form. This > > contact link is located in my default.ctp > > > But where I have to add now this: > > $this->set('mathCaptcha', $this->MathCaptcha->generateEquation()); > > to setup thecaptcha? > > > Because now I get a Undefined variable: mathCaptcha [APP\views\elements > > \news.ctp, line 11] > > And line 11 is the place where I call the > > <?php echo $form->input('security_code', array('label' => '<span > > class="hint" style="padding-top: 40px;">Anti-Spam:<br /></span>What > > is: ' . $mathCaptcha, 'style' => 'width: 20px;margin-top:7px;')); ?> > > > I am lost.... > > > -- > > Our newest site for the community: CakePHP Video > > Tutorialshttp://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp > > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > > [email protected] For more options, visit this group > > athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
