PHP HELP? Cannot send session cache limiter - headers already sent?

The Awaken

New member
The HTTP header is sent before you send any HTML to the client.

Thus, if you have a single space in your code... anything at all before you call a function that makes use of the HTTP header (i.e. the "session" call).... it will fail, as the header has already been sent.

For this, you need to make sure your document starts with <?php , without any data before it... then immediately call the "session" function, or whatever resource you are using that makes use of the HTTP header.
 
This is the source I wrote:


<form action="processscript.php" method="post">
<textarea rows="25" cols="65" name="content">
<?php
require 'init.inc.php';
if ($_SESSION['sess_rcon_rights'] != 1)
{

die($lang['rights_error']);

} else
$fn = "users.inc.php";
print htmlspecialchars(implode("",file($fn)));
?>
</textarea><br>
<input type="submit" value="Change!">
</form>

I am getting this in the text box

<br />
<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /media/media99/htdocs/rcon/admin.php:4) in <b>/media/media99/htdocs/rcon/validate.inc.php</b> on line <b>5</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /media/media99/htdocs/rcon/admin.php:4) in <b>/media/media99/htdocs/rcon/validate.inc.php</b> on line <b>5</b><br />

What am I doing wrong?
 
Back
Top