<table>
<tr>
<td width="30"></td>
<td><img src="Images/logo.jpg" width="100" height="100" />
<td><td><h2> Kunal Structures (India) Pvt. Ltd.</h2></td>
</tr>
</table>
<?php
if(!isset($_SESSION['user_id']))
{
header("location:http://127.0.0.1/New%20folder/KSIPL1.10/KSIPL/index.php");
}
else
{
$now = time(); // checking the time now when home page starts
if($now > $_SESSION['expire'])
{
header("location: http://127.0.0.1/KSIPL1.10/KSIPL/index.php");
echo "Session Expired !"." <a href='http://127.0.0.1/New%20folder/KSIPL1.10/KSIPL/index.php'>"." <h1> ".
"Login again"." </h1>"."</a>";
session_destroy();
}
else
{
$qry = mysql_query("SELECT * FROM user_main WHERE user_id=".$_SESSION['user_id']."");
$loguser=mysql_fetch_assoc($qry);
?>
<table class="headerinfo" align="right">
<tr>
<td>You are <span style="color:#40B3BA;"><?php echo $loguser['user_name']; ?></span>,</td>
<td><a style="color:#f5f5f5; text-decoration:none;" href="logout.php"><b>Logout</b></a></td>
<td> </td>
</tr>
</table>
<br/>
</div>
<?php
if($loguser['user_type'] == "Administrator") //Custom Menubar for Administrator
{
?>
<div class="row-fluid">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#"></a>
<ul class="nav">
<li><a href="">Home</a></li>
<li><a href="">Documents</a></li>
</ul>
</div>
</div>
</div>
<?php
}
}
}
why it shows me an error like header already sent and do not redirect to given path.
When session_['expire'] condition becomes true it shoud be move to index.php
file but it not happen because of the header error.
How can i solve this problem. Is there any solution for avoiding header error.