Jump to content

session_start


woodplease

Recommended Posts

i keep getting this error whenever i load my page

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\wiki\index.php:1) in C:\xampp\htdocs\wiki\index.php on line 2


<?php
session_start();

include "includes/dbconnect.php";
include "includes/functions.php";
forum_connect();
?>
<!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>
<link rel="stylesheet" type="text/css" href="../style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Wiki</title></head>
<body id="page1">

  <div id="header">
    <div class="container">

    	<div class="logo">
      	<a href="index.html"><img src="images/logo.gif" alt="logo" /></a>
      </div>

 

i've made sure that session_start() is at the very top, and there are no rogue spaces or breaks , so i dont know why i'm getting the error. any ideas?

 

thanks

 

 

Link to comment
Share on other sites

Your problem is likely the BOM characters.

 

Save your file without the BOM characters or save it as an ANSI/ascii encoded file.

 

@BlueSkyIS, the forum's [ php ] tag menu item messes up the code that is posted by adding all kinds of tabs/newlines, so you cannot go by what gets posted through that method.

 

i've looked through that thread, and it the suggestions dont solve the problem

Yes, well you didn't bother to state what you tried.

Link to comment
Share on other sites

i think i've removed all of the bom characters, but its still not working

 

i've posted the entire code in case anyone can see the error

<?php
session_start();
include "includes/dbconnect.php";
include "includes/functions.php";
forum_connect();
?>
<!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>
<link rel="stylesheet" type="text/css" href="../style.css" />

<title>Wiki</title></head>
<body id="page1">

  <div id="header">
    <div class="container">

    	<div class="logo">
      	<a href="index.html"><img src="images/logo.gif" alt="logo" /></a>
      </div>

      <?php nav_menu3(); ?>

    </div>
  </div>
  <div id="main">

    <div id="content">

    	<div class="mainBanner">
      	<div class="indent">
        	<h1>SiFi Wiki<strong>Get your data here!</strong><strong></strong></h1>
      	</div>
      </div>

      <div class="wrapper">
        <div class="aside left">
        	<div class="inside">
        	  <h3>Menu</h3>
            <ul class="list1">
            	            	<li>
                
<?php menu(); ?>

            </ul>
             <a href="news.php">Read More... </a></div>
        </div>
        <div class="mainContent">
        	<div class="section">
             <div class="box">
              <div class="top">
                <div class="bot">
                  <div class="inner">
                    <h2><img src="images/icon1.gif" alt="" /><strong><br/>Wiki's</strong><br/></h2>
                   <?php
$entry = mysql_query("SELECT * FROM entry ORDER BY entry_title") or die ("Query failed");
$numofrows2 = mysql_num_rows($entry);
for($j = 0; $j < $numofrows2; $j++) { 
   	$row2 = mysql_fetch_array($entry);  
echo "<a href='view_entry.php?wiki={$row2[entry_title]}'>".stripslashes($row2[entry_title])."</a> ";
echo "<br/>";
}
?></div>
                </div>
              </div>
            </div>
            
          </div>
        </div>
      </div>
    </div>
    
    <div id="footer">
    	<?php login(); ?>  <a href="about.html">About</a>
    </div>
  </div>

</body>
</html>

 

Link to comment
Share on other sites

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.