Jump to content

Recommended Posts

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:8) 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:8) 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!!

Link to comment
https://forums.phpfreaks.com/topic/241707-headers-already-sent-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.