Re: wrapper function not working!
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 wrote: > Thank you man. > Im a newbie as you could tell. > -Armen > > On Aug 12, 1:07 am, John Andersen 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 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 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 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 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 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 bec
Re: wrapper function not working!
Thank you man. Im a newbie as you could tell. -Armen On Aug 12, 1:07 am, John Andersen 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 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 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 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 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 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 -~--~~~~--~~--~--~---
Re: wrapper function not working!
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 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 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 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 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 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 -~--~~~~--~~--~--~---
Re: wrapper function not working!
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 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 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 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 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 -~--~~~~--~~--~--~---
Re: wrapper function not working!
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 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 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 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 -~--~~~~--~~--~--~---
Re: wrapper function not working!
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 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 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 -~--~~~~--~~--~--~---
Re: wrapper function not working!
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 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 -~--~~~~--~~--~--~---
wrapper function not working!
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 -~--~~~~--~~--~--~---