mrblackops195 Posted June 17, 2012 Share Posted June 17, 2012 i get this Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /www/zxq.net/a/t/c/atc230tigers/htdocs/index.php:1) this is my code <?php include "connect_to_mysql.php"; session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <?php require_once "index.php"; ?> <head> <!-- Page Title --> <title>230 (Congleton) Squadron Air Training Corps - Welcome</title> <!-- Stylesheets --> <link rel="Stylesheet" type="text/css" href="style.css" /> <!-- Scripts --> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/easySlider.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#slider").easySlider(); }); </script> </head> <body> <!-- Global Wrapper --> <div id="global_wrapper"> <!-- Header Open --> <!-- Header Container --> <?php include "header.php"; ?> <!-- //Header Container --> <!-- //Header --> <!-- Navigation --> <?php include "menubar.php"; ?> <!-- //Navigation --> <!-- Content Global --> <table id="content_global"> <!-- Column 1 --> <!-- Width 450px --> <div id="content_col1"> <!-- Featured Slide Show --> <div id="content_SLIDER"> <div id="slider_nav"> <span id="prevb script:void(0);"></a></span> <span id="nextBtn"><a href="java script:void(0);"></a></span> </div> <div id="slider"> <ul> <li> <div class="slide_global"> <div class="slide_image"> <img alt="" src="images/slide1_img.jpg" /> </div> <div class="slide_copy"> <div class="title"> Hot off the press </div> <div class="copy"> Download the latest edition of the squadron magazine <br /> <br /> <a href="docs/rag.pdf">Click Here</a> </div> <div class="indicator"> <img src="images/indicator_1.gif" /> </div> </div> </div> </li> <li> <div class=slide_global"> <div class="slide_image"> <img alt="" src="images/slide1_img.jpg" /> </div> <div class="slide_copy"> <div class="title"> Hot off the press </div> <div class="copy"> Download the latest edition of the squadron magazine <br /> <br /> <a href="docs/rag.pdf">Click Here</a> </div> <div class="indicator"> <img src="images/indicator_2.gif" /> </div> </div> </div> </li> <li> <div class=slide_global"> <div class="slide_image"> <img alt="" src="images/slide1_img.jpg" /> </div> <div class="slide_copy"> <div class="title"> Hot off the press </div> <div class="copy"> Download the latest edition of the squadron magazine <br /> <br /> <a href="docs/rag.pdf">Click Here</a> </div> <div class="indicator"> <img src="images/indicator_3.gif" /> </div> </div> </div> </li> </ul> </div> </div> <!-- //Featured Slide Show --> <!-- What's On --> <div id="content_WHATSON"> <!-- Header --> <div id="header"> What's on at 230 Squadron? </div> <!-- //Header --> <!-- Content Area --> <div id="content_area"> <!-- News Items Open --> <div class="item"> <p class="title">Title</p> <p class="copy">Information Goes Here</p> <p class="date">Date Goes Here</p> </div> <div class="item"> <p class="title">Title</p> <p class="copy">Information Goes Here</p> <p class="date">Date Goes Here</p> </div> <div class="item"> <p class="title">Title</p> <p class="copy">Information Goes Here</p> <p class="date">Date Goes Here</p> </div> <!-- //News Items Close --> </div> <!-- //Content Area --> </div> <!-- //What's On --> </div> <!-- //Column 1 --> <!-- Column 2 --> <!-- Width 450px --> <div id="content_col2"> <!-- Welcome --> <div id="content_WELCOME"> <div id="copy">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent risus augue, faucibus vel iaculis vel, pharetra vitae sapien. Integer venenatis, nunc at facilisis auctor, leo odio ultrices nulla, elementum vehicula justo diam in magna. Praesent justo tortor, vehicula vel egestas id, ornare at lectus. Etiam molestie vulputate rutrum. Mauris vel nisl quam, non rutrum velit. Morbi sit amet orci nec diam adipiscing imperdiet eget a velit.</div> </div> <!-- //Welcome --> <!-- Joining --> <div id="content_JOIN"> <div id="overlay"> <p class="h1">Interested In Joining?</p> <p class="h2">For more information click <a href="join.html">here</a></p> </div> </div> <!-- //Joining --> </div> <!-- //Column 2 --> </table> <!-- //Content Global --> <!-- Footer Global --> <?php include "footer.php"; ?> <!-- //Footer Global --> <!--//Global Wrapper --> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/264331-session-wont-start-i-get-an-error/ Share on other sites More sharing options...
Pikachu2000 Posted June 17, 2012 Share Posted June 17, 2012 Missed the sticky topic, did you? HEADER ERRORS - READ HERE BEFORE POSTING THEM Quote Link to comment https://forums.phpfreaks.com/topic/264331-session-wont-start-i-get-an-error/#findComment-1354603 Share on other sites More sharing options...
KevinM1 Posted June 17, 2012 Share Posted June 17, 2012 Also, put all your code in tags when posting on the forums. Quote Link to comment https://forums.phpfreaks.com/topic/264331-session-wont-start-i-get-an-error/#findComment-1354605 Share on other sites More sharing options...
PFMaBiSmAd Posted June 17, 2012 Share Posted June 17, 2012 Also, the only relevant code that you needed to post is the code that the error message is referring to, so lines 1-3. Quote Link to comment https://forums.phpfreaks.com/topic/264331-session-wont-start-i-get-an-error/#findComment-1354608 Share on other sites More sharing options...
Nyuszer Posted June 17, 2012 Share Posted June 17, 2012 change <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <?php require_once "index.php"; ?> <head> to <?php require_once "index.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> session id is stored client side in cookies and php can't send any cookie after any html code Quote Link to comment https://forums.phpfreaks.com/topic/264331-session-wont-start-i-get-an-error/#findComment-1354611 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.