Session Start Doensnt Work, plz help |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Web Design & Development Server Side Scripting PHP |
||
![]() |
Session Start Doensnt Work, plz help |
||
Jun 17 2012, 01:41 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 1 Joined: 17-June 12 Member No.: 246,154 |
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> Click here to see yourself |
|
|
Jul 7 2012, 07:40 PM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 10 Joined: 4-December 11 Member No.: 220,644 |
I don't know what's in connect_to_mysql.php, but I'm guessing it sends some headers or something... I think you should put
CODE session_start() before CODE include "connect_to_mysql.php" That way you are sure that the PHP session cookie is sent properly. Also, make sure you do not have any line breaks before the first <?php tag, because they are counted as output.
|
|
|
![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 24th May 2013 - 02:39 AM |