Thursday, February 3, 2011

Login Form not working for noob

Hey guys, just started using CakePHP yesterday, so I guess, you may find many error in this one. My problem is,


function taa_login($password = null) { $this->Session->setFlash('You are at the taa-login page.'); if(isset($this->data)){ $this->post->pass = $password; if(empty($this->data)) { echo('You gotta enter a proper password, nigga.'); } else { $this->Session->setFlash('You are correct. Your password is '); $this->redirect(array('action' => 'index')); } } }

This was my controller code. I have created the view, here it is 

<!-- File: /app/views/posts/taa_login.ctp --> <h1>Login</h1> <?php echo $this->Form->create('Post', array('action' => 'taa_login')); echo $this->Form->input('password'); echo $this->Form->end('Login'); ?>

My problem is that I don't know how to handle the variables from that form. For example, the password thing, how do I handle that in my controller? Also, there is one another thing I can't understand, where do I check whether the password supplied is right or not, the model or the controller?

 
 
 

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: