Forum Moderators: coopster
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
dc
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
<?phpsession_start();
echo "<table border='1'><tr><td>";
//include "sec/registered.php";
echo "</td><td>duck all!</td>";
echo "<td>";
//include "ievade.php";
echo "</td>";
//session_close();
?>
Ive commented all of the includes out, so nothing should be taken from those files.
and it still gives me:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\LJO\index.php:2) in D:\xampp\htdocs\LJO\index.php on line 4
duck all! And heres the page source:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1257"><script charset="utf-8" id="injection_graph_func" src="chrome://skype_ff_toolbar_win/content/injection_graph_func.js"></script></head><body><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 D:\xampp\htdocs\LJO\index.php:2) in <b>D:\xampp\htdocs\LJO\index.php</b> on line <b>4</b><br>
<table border="1"><tbody><tr><td></td><td>duck all!</td><td></td></tr></tbody></table></body></html>
Im totally lost here. Started working with sessions just recently, and until this, ive been ok.
You will need to start your sessions before outputting any content.
so if:
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
<?php
session_start();
Is at the top of your file then change it to:
<?php
session_start();
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">