There is no $this->exit() function.  Perhaps you are thinking of $this-
>_stop()?  Also in 1.2 there is no need to manually call exit().  It
is called automatically by redirect().

Your redirect call seems suspect as well.  I would just use $this-
>redirect('/users/login');  Of course it is always better to use array
urls.

-Mark

On Nov 24, 4:34 pm, _Z <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am redirecting a user to a login page after they register for an
> account. A message is displayed to login with their new credentials.
> However when the form is submitted to login, they are instead
> redirected back to the register view.
>
> It would appear that code after the redirect() call is running, but I
> call $this->exit() as instructed.
>
> I am completely stuck on this one! :p
>
> Sample code:
>
> function register() {
>         if (!empty($this->data)) {
>
>                 #process the data from POST. Check to see if hashed
> values match
>                  if ($this->data['User']['password'] == $this->Auth-
>
> >password($this->data['User']['password_confirm'])) {
>
>                 #create a new object
>                 $this->User->create();
>
>                 #apply this new data
>                 $this->User->save($this->data);
>
>                 #these params in redirect will exit function
>                 $this->Session->setFlash('Account created succesfully.
> Please log in');
>                 $this->redirect('/users/login', null, $status = true);
>                 $this->exit();
>                 }
>
>                 else {
>                 #if dont match flash on screen and redirect
>                 #$this->flash('passwords need to match','/user/
> register');
>                 $this->Session->setFlash('passwords need to match');
>
>                 }
>         #empty data, this is fine.
>         }
>
> }#end register
--~--~---------~--~----~------------~-------~--~----~
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