Issues with frames and sessions
Posted: Wed May 26, 2010 7:40 am
Hello, I am using two frames, one for navigation and the other for content. The navigation will display news and other information if there is not a session set, the content, once logged in will set the session then reload the menu frame, however it is displaying the following error:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (error on line 2 [session_start()]
Snippet from the authentication page.
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (error on line 2 [session_start()]
Code: Select all
<php
session_start();
include 'connect.php';
?>
<?php
if (isset($_SESSION['player']))
{
echo "<a href=\"overview.php\" target=\"content\"><p align=\"center\">Overview</p></a>";
echo "<a href=\"town.php\" align=\"center\" target=\"content\"><p align=\"center\">Town</p></a>";
echo "<a href=\"charsheet.php\" align=\"center\" target=\"content\"><p align=\"center\">Character Sheet</p></a>";
echo "<a href=\"skills.php\" align=\"center\" target=\"content\"><p align=\"center\">Skills</p></a>";
echo "<a href=\"market.php\" align=\"center\" target=\"content\"><p align=\"center\">Market</p></a>";
echo "<a href=\"guild.php\" target=\"content\"><p align=\"center\">Guild Hall</p></a>";
echo "<p align=\"center\"><img src=\"images/standard.jpeg\" align=\"middle\"></p>";
echo "<p align=\"center\">HP: xxx/xxx</p>";
echo "<p align=\"center\">IP: xxx/xxx</p>";
}
else
{
echo "<h2>News:</h2>";
echo "<p>Frame and menu added 05-26-2010</p>";
echo "<p>Registration live 05-18-2010</p>";
}
?>Code: Select all
if($result2)
{
session_start();
$_SESSION['player']=$player;
print "logged in successfully<br><br>";
print "<A href='content.php'>Play!</a>";
print("<script language ='javasript'>top.menu.locatin.reload();</script>");
}