CodeIgniter Forums

Full Version: Redirect function not working in the different server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]y0rkez[/eluser]
Hello, I'm newbie using CI framework, I've finished working my first CI framework project, but I have a problem on redirecting URL, example for login authorization.
I've run my application on my server and it's done, but when I run on another server it has a problem with the following error:

Quote:A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/sloki/user/h26319/sites/blabla.com/www/system/libraries/Exceptions.php:164)

Filename: helpers/url_helper.php

Line Number: 541

I don't understand what its mean, does anybody has solution?

El Forum

[eluser]rogierb[/eluser]
Did you check for spaces after php closing tag?

It might be something a simple as that.

El Forum

[eluser]y0rkez[/eluser]
OK thank you *rogierb for your suggestion, I'll try to check it.

El Forum

[eluser]BrianDHall[/eluser]
Alternatively it can be an encoding issue, commonly coming up with UTF-8 and how some editors handle it.

This is also common in transitions between unix and windows servers, as some editors add extra junk because they don't understand the line breaks very well. Also note that ?> is unnecessary in things like controllers, models, etc - don't use them to avoid the chance of having an extra line-break or space at the end of a file that screws up your headers.

El Forum

[eluser]y0rkez[/eluser]
Thank you *BrianDHall, I had found the solution, the server doesn't support header_refresh so I changed with header_location and it can be run.