OlgaBunkleyk
New Member
I have a site hosted on the internet. On this page, i need a session to start. I get the errors Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/58/9335458/html/ourgames.php:15) in /home/content/58/9335458/html/ourgames.php on line 7Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/58/9335458/html/ourgames.php:15) in /home/content/58/9335458/html/ourgames.php on line 7What is wrong with my code?\[code\]<!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"><head><?phpsession_start ();?><meta http-equiv="content-type" content="text/html; charset=utf-8" /><title>site</title><meta name="description" content="Web Application" /><meta name="keywords" content="web, application" /><link href="http://stackoverflow.com/questions/10543520/css/main.css" rel="stylesheet" type="text/css" /></head><body><div id="header"><div id="phapsy"> <h1><a href="http://stackoverflow.com/questions/10543520/index.html">site</a></h1> </div><div id="menuholder"> <ul id="menu"> <li><a href="http://stackoverflow.com/questions/10543520/index.html">home</a></li> <li class="active"><a href="http://stackoverflow.com/questions/10543520/ourgames.php">our games</a></li> <li><a href="http://stackoverflow.com/questions/10543520/register.php">register</a></li> <li><a href="http://stackoverflow.com/questions/10543520/aboutus.php">about us</a></li> <li><a href="http://stackoverflow.com/questions/10543520/contact.html">contact us</a></li> </ul> </div> <?phpif (isset($_SESSION['username']));elseecho" <div id='login'> <form action='login.php' method='POST'><table><tr><td>Username: </td><td><input type='text' name='username'/></td><td>Password: </td> <td><input type='password' name='password'/></td> <td><input type='submit' name='submit' value='http://stackoverflow.com/questions/10543520/Login'/></td></tr></table></form></div>";?></div><div id="teaser"> <div class="wrap"> <div id="image"></div> <div class="box"><?phpif (isset($_SESSION['username']))echo "<h2>Welcome to the page about the app!</h2><p>Information about the application will go here</p>";else echo("<h2>You must be logged in to view this page. <br><a href='http://stackoverflow.com/questions/10543520/register.php'>Register</a> to gain access and learn more about <br>the application.</h2>");?> </div> </div></div><div id="bar"> <div class="wrap"> </div></div><?phpif (isset($_SESSION['username']))echo "<div class='wrap'> <div class='col'> <h3>Data</h3> <p>More info </p> </div> <div class='col'> <h3>Value</h3> <p>More info</p> </div> <div class='col last'> <h3>Goal</h3> <p>More info</p> </div></div><div id='footer'></div>";elseecho("<div id='footer'></div> ");?></body></html>\[/code\]