Paul,
Got any spaces or lines above the "<?" ??  Spaces there will kill the
script.
Hugh
----- Original Message -----
From: "Paul" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 03, 2002 9:53 AM
Subject: [PHP] Am I blind? simple 15 line code producing error


> 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
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to