upendra470 Posted July 11, 2011 Share Posted July 11, 2011 I have been running my project on localhost, it works perfectly fine. But as soon as I have uploaded on web i got two warnings. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/gal37542/public_html/control/_includes/header.html: in /home/gal37542/public_html/control/session.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /home/gal37542/public_html/control/_includes/header.html: in /home/gal37542/public_html/control/session.php on line 34 Here my header.html file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Control Panel for IHROYDC</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="Galaxias" content="cpanel " /> <meta name="description" content="Cpanel for IHROYDC" /> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <div id="header">International Human Rights Organization<div class="header">Control Panel for IHROYDC Official Website</div></div> <div id="menu"> <div class="menu"><a href="home.php">home</a></div><div class="menu"><a href="user.php">User</a></div><div class="menu"><a href="news.php">News</a></div> <div class="menu"><a href="gallery.php">gallery</a></div><div class="menu"><a href="testimonials.php">Testimonials</a></div><div class="menu"><a href="events.php">Events</a></div><div class="menu"><a href="legaladvice.php">Legal Advice/Complaints</a></div><div class="menu"><a href="casestudies.php">Case Studies</a></div><div class="menu"><a href="sendmail.php">send mail</a></div> </div> and here is session.php <?php session_start(); if (isset($_SESSION['valid_user'])) { echo '<h3>You are logged in as: '.$_SESSION['valid_user'].'</h3>'; echo '<h1 align = "right"><a href = "logout.php">Logout </a></h1>'; $now = time(); $limit = $now - 60 * 10; if (isset ($_SESSION['last_activity']) && $_SESSION['last_activity'] < $limit) { // if too old, clear the session array and redirect $_SESSION = array(); header('Location: index.html'); exit; } else { // otherwise, set the value to the current time $_SESSION['last_activity'] = $now; } } else { if(isset($username)) { echo 'Could not log you in'; } else { header("location:access-denied.php"); } } ?> Please tell me asap. Any info will be of great help!! Quote Link to comment https://forums.phpfreaks.com/topic/241707-headers-already-sent-problem/ Share on other sites More sharing options...
Kustom_Vegas Posted July 11, 2011 Share Posted July 11, 2011 http://www.phpfreaks.com/forums/index.php?topic=37442.0 Quote Link to comment https://forums.phpfreaks.com/topic/241707-headers-already-sent-problem/#findComment-1241399 Share on other sites More sharing options...
JKG Posted July 11, 2011 Share Posted July 11, 2011 all to do with header errors, but the reason it will have just started showing them is your error settings will be different on your live server to your local one. Quote Link to comment https://forums.phpfreaks.com/topic/241707-headers-already-sent-problem/#findComment-1241443 Share on other sites More sharing options...
premiso Posted July 11, 2011 Share Posted July 11, 2011 all to do with header errors, but the reason it will have just started showing them is your error settings will be different on your live server to your local one. Or his local server has output buffering enabled. Quote Link to comment https://forums.phpfreaks.com/topic/241707-headers-already-sent-problem/#findComment-1241450 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.