Perhaps I am blind but I have the following simple code that gets me
errors:
<?php
session_start();
require_once ("config.inc");
require_once "classes/HtmlTemplate.class";
if ($HTTP_SESSION_VARS[user_id]){
//do something
} else {
$message= "*** Area is restricted! Please login! ***";
$m= urlencode($message);
$sid_value="&PHPSESSID=".session_id();
header("Location:
index.php?error_message=$m$sid_value");
exit;
}
?>
The error is:
Warning: Cannot add header information - headers already sent by (output
started by.. ..line 6) ...on line 12
Line 6 is the line with if ($HTTP_SESSION_VARS[user_id])
Line 12 is the line starting with header
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php