Welcome Guest, Not a member yet? Register   Sign In
Problem with header information
#1

[eluser]Unknown[/eluser]
On my local apache server codeigniter works well but when i upload it on another web server i see this:

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /www/sport168.net/esound/root/application/controllers/RlController.php:5)

Filename: libraries/Session.php

Line Number: 672
#2

[eluser]j0se[/eluser]
Hi.

Can you put the code of /www/sport168.net/esound/root/application/controllers/RlController.php
only 7 lines??
#3

[eluser]Unknown[/eluser]
Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<?php

class RlController extends CI_Controller{
#4

[eluser]j0se[/eluser]
In your local webserver perhaps have "display_errors=Off" in php.ini.

But IMHO the header information write in a view not in a controller ( see MVC ).
#5

[eluser]CroNiX[/eluser]
Its because of the HTML in the top of your controller code. That shouldn't be there. When that file loads, it outputs the html from the top of the file, causing the headers to be sent already before CI gets a change to process anything and send its own output. HTML should be loaded from a view file within the controller so that CI can output everything at once (it's buffered).




Theme © iAndrew 2016 - Forum software by © MyBB