Page 1 of 1

I get a message saying header already sent, please help me

Posted: Fri Aug 14, 2009 3:56 am
by misssallyworld

Code: Select all

<?php
session_start();
 
include($config['webroot'].'../library/config.php');
include($config['webroot'].'library/connectdb.php');
include($config['webroot'].'library/selectdb.php');
 
if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] != true) {
    header('Location: admin/login.php');
    exit;
    }
?>
<?php
 
    include('../library/config.php');
    include($config['webroot'].'library/connectdb.php');
    include($config['webroot'].'library/selectdb.php');
 
if(isset($_SESSION['views']))
    $_SESSION['views'] = $_SESSION['views']+ 1;
else
    $_SESSION['views'] = 1;
echo "views = ". $_SESSION['views']; 
 
 
?>


there's no other headers or start sessions() on the page, I've been staring at it for so long. please help me someone
this is the link if you want to see the error massage http://stuweb.cms.gre.ac.uk/~bs107/gigb ... =20&p_f=20

Re: I get a message saying header already sent, please help me

Posted: Fri Aug 14, 2009 4:28 am
by onion2k
One of your include files has a space outside of the <?php ?> tags.

Re: I get a message saying header already sent, please help me

Posted: Fri Aug 14, 2009 4:49 am
by webmonkey88
You have some whitespace before your session_start(), there could be a space before the <?php.