No problem :) For your information - if you do not specify an action in the form- >create statement, cakePHP default to the add action, which is why your register form invokes the add action in your controller!
Enjoy, John On Aug 12, 11:46 am, armen <oldar...@gmail.com> wrote: > Thank you man. > Im a newbie as you could tell. > -Armen > > On Aug 12, 1:07 am, John Andersen <j.andersen...@gmail.com> wrote: > > > Thanks Armen, > > > Your register.ctp is missing the action parameter in the form->create > > statement! Compare it with the login.ctp, where it is correctly > > specified! > > > As soon as you specify the register action in the form->create > > statement, it will invoke the register action in your controller! > > > Best wishes, > > John > > > On Aug 12, 9:54 am, armen <oldar...@gmail.com> wrote: > > > > Sure, sorry I should've posted earlier. > > > > \view\users\index.ctp =>http://www.warplayart.com/ > > > bleed_till_death/delete_when_done/index.ctp > > > \view\users\login.ctp =>http://www.warplayart.com/ > > > bleed_till_death/delete_when_done/login.ctp > > > \view\users\register.ctp =>http://www.warplayart.com/ > > > bleed_till_death/delete_when_done/register.ctp > > > \controllers\users_controller.php =>http://www.warplayart.com/ > > > bleed_till_death/delete_when_done/users_controller.tphp > > > > -Cheers, > > > Armen > > > > On Aug 11, 10:58 pm, John Andersen <j.andersen...@gmail.com> wrote: > > > > > Please show the code for the view in which you are creating the form > > > > for the user to register him-/herself! > > > > Enjoy, > > > > John > > > > > On Aug 12, 5:15 am, armen <oldar...@gmail.com> wrote: > > > > > > It's not working really. I tried it again... > > > > > if you click on the second link, where you register a username and > > > > > password, then by clicking the submit button, you should be redirected > > > > > to the index page without any problems since I'm creating a session > > > > > and redirecting. > > > > > $this->Session->write('User', $data); > > > > > $this->redirect('index'); > > > > > > Second the username and pass is not inserted in the database, so if > > > > > you click on the first link to enter the username and password you > > > > > just created, it won't let you login. > > > > > > -Armen > > > > > > On Aug 11, 12:43 am, anurag pal <mail.anurag....@gmail.com> wrote: > > > > > > > Hi, > > > > > > > I have checked the code its working properly. > > > > > > > Please cross check your method which checking for logged User. It > > > > > > might be in beforeFilter because its asking for log-in. > > > > > > > Regards, > > > > > > Anurag Pal > > > > > > > On Aug 11, 12:25 pm, armen <oldar...@gmail.com> wrote: > > > > > > > > This is the link to the webpage that im working > > > > > > > on...http://warplayart.com/bleed_till_death/UserLoging/users > > > > > > > and this is the link that you register a > > > > > > > user...http://warplayart.com/bleed_till_death/UserLoging/users/register > > > > > > > > But the form on the register page, calles add in for it's action > > > > > > > variable, even though im calling the register function from the > > > > > > > url. > > > > > > > So i ended up using a wrapper like this which doesn't work. > > > > > > > > What am i doing wrong? > > > > > > > > + when i was just using the add (http://warplayart.com/ > > > > > > > bleed_till_death/UserLoging/users/add) and placed the code inside > > > > > > > the > > > > > > > add function it worked fine. > > > > > > > > --------------------------------------------------------------------------------- > > > > > > > function add() { > > > > > > > $this->register($this->data); > > > > > > > } > > > > > > > > function register($data = null) { > > > > > > > > if (!empty($data)) { > > > > > > > > $data['User']['password'] = > > > > > > > md5($data['User']['password']); > > > > > > > $this->User->create(); > > > > > > > > if ($this->User->save($data)) { > > > > > > > > > > > > > > $this->Session->setFlash(__('User successfully registered', > > > > > > > true)); > > > > > > > > > > > > > > $this->Session->write('User', $data); > > > > > > > $this->redirect('index'); > > > > > > > exit(); > > > > > > > } > > > > > > > else { > > > > > > > > > > > > > > $this->Session->setFlash(__('The Post could not be saved. > > > > > > > Please, try again.', true)); > > > > > > > } > > > > > > > } > > > > > > > } > > > > > > > -------------------------------------------------------------------------------------------- > > > > > > > > Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---