[eluser]Twisted1919[/eluser]
1. the isset($is_logged_in) is useles.
2. putting the javascript where you want is WRONG for 2 reasons:
a) the controller NEVER echo's data , the views do that, so you need to load a view to spit those alerts .
b) if you echo something before redirect, you'll end up with an "headers already sent" error .