You can't redirect from the server (PHP) when making an AJAX request.
You can only send a response back to the client. If your server code
determines that the user needs to be redirected, it should inform your
client-side code--the javascript function making the AJAX
request--that *it* should handle the redirect.


On Thu, Jul 23, 2009 at 12:52 PM,
DatacenterHellas<[email protected]> wrote:
>
> Ok . . .
>
> this is one aproach of the problem but I think is not the most
> correct.
>
> I mean what about if the user will not enter correct data ? ? ?
>  Have I to redirect him to an action and then will return again to
> login ? ? ?
>
> Is not so nice.
>
> My project is based on CakePHP and ExtJS.
>
> For the Login I have create a form with ExtJS to send the username and
> password to CakePHP thru HTTP Post.
>
> Then from the CakePHP users controller I putting the POST values to
> $this->data['User']['username'] = $_POST['username'] and the password
> too.
>
> After that the Cake know how to login by using the Auth component.
>
> After the user is login the $this->Auth->loginRedirect is going to
> Users Index action.
>
> From the firebug I see that the request is implemented correctly but
> what I get is the same screen. My Web Browser is not updated to go to
> the Users Index action.
>
> That is what I like to do.
>
> Any other Idea ? ? ?
>
> Thanks a lot :)
> >
>

--~--~---------~--~----~------------~-------~--~----~
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