Redirect not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Redirect not working (/showthread.php?tid=43764) |
Redirect not working - El Forum - 07-22-2011 [eluser]webnology[/eluser] Hi everyone, I have a simple redirect in my code, which is simply not working. It gets on an empty, blank ,white page. Any idea what could be wrong? Code: redirect('/customers/dashboard', 'refresh'); Many thanks, Michel Redirect not working - El Forum - 07-22-2011 [eluser]Xclamation Design[/eluser] Hi Michael, Could you possibly provide a little more code? Perhaps you could provide the code for your controller/model where you are calling the 'redirect' and also the controller for '/customers/dashboard'? Redirect not working - El Forum - 07-22-2011 [eluser]webnology[/eluser] Hey Michael, true. Here's some more info. It's the cotroller where I add the form to the db. Code: function addCustomer() { I also get these 2 errors: A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /var/www/html/system/core/Exceptions.php:170) Filename: libraries/Session.php Line Number: 671 A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /var/www/html/system/core/Exceptions.php:170) Filename: helpers/url_helper.php Line Number: 543 All help appreciated, Michel Redirect not working - El Forum - 07-22-2011 [eluser]Xclamation Design[/eluser] Hi Michael, The error you are getting is a common one and suggest that something is being printed/echoed to screen before the redirect takes place. This is why you are getting the message 'Cannot modify header information'. This may be in another controller/method/function somewhere before where you call the 'store user function'. Let us know how you get on or if you require any further help. Regards, Redirect not working - El Forum - 07-22-2011 [eluser]boltsabre[/eluser] yeah, as Xclamation Design has said, you're printing/echo'ing something somewhere. I often get this message during development, often I have a print_r statement in my model where I've been checking output from the DB, that I've forgotten to delete. Redirect not working - El Forum - 07-23-2011 [eluser]webnology[/eluser] ok, thx guys for the help. I still had sth in my index.php file for date outputting. Forgot about that. :-) |