I understand that the header() info should go before anything else. But I am processing some multilingual data and based on form values sent from a form. The header() should be written dynamically using some charset information I retrieve from a class + the posted values. Plus I have some session stuff I have to deal with as well. But what goes first?
session_start();
require("lib/YakuNuke.class.php");
require("lib/FileUpload.class.php");
require("lib/FileWriter.class.php");
// prepare header for correct language display
$enc = new HTMLEncoding($_REQUEST["targetlang"]);
header("Content-type: text/html; ".$enc->getEncodingHeader());
That would print something like "charset=Shift_JS"
I initially wrote it to work on a Windows+Apache+PHP machine... and it works fine. Yet on LAMP it keeps on giving me the "Warning: headers already sent blabla".
What can I do to solve it?
thnx