Jump to content

Recommended Posts

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>

post-134678-1348240359489_thumb.jpg

Link to comment
https://forums.phpfreaks.com/topic/264331-session-wont-start-i-get-an-error/
Share on other sites

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.