Posted by Philip Hallstrom on 05/27/05 18:03
Make sure you don't have any blankspace before or after the <?php ... ?>
in your stats.php file. That's usually what does it.
On Sat, 21 May 2005, Ross wrote:
> I have the folowing code which checks whether the user has logged in.
>
> if (!isset ($_SESSION['new_session'] ) )
> {
>
> $login_status = "<div class=\"standard_text\">Your are not signed in
> </div>";
>
> }
> if (isset ($_SESSION['new_session'] ) )
> {
> $address = $_SESSION['new_session'];
> $login_status = "<div class=\"standard_text\">Your are signed in as <span
> class=\"under\">$address</span></div>";
> }
> ?>
>
>
> Now when I have this as a file to be included in each page, status.php (see
> code) gives the header error (already sent).
>
> <?php
> session_start();
> include('status.php');
>
>
> When the code is pasted in each individual page it works fine. This is no
> big deal but it is annoying me! why does this not work.
>
> I have also tried require_once & include_once() but nothin works.
>
> Later on in the page there is a form which sets some cookies and uses
> php_self() to send the data to itself.
>
> Ross
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
[Back to original message]
|