By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,805 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

ERROR Message Warning: session_start()

P: 1
I GET THE ERROR MESSAGE:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/aagconsu/public_html/aplomarksdtc.co.za/login.php:15) in /home/aagconsu/public_html/aplomarksdtc.co.za/include/fg_membersite.php on line 137




BELOW is my PHP script do i do something wrong?
Please help.
Expand|Select|Wrap|Line Numbers
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  4. <title>Welcome</title>
  5. <meta name="keywords" content="" />
  6. <meta name="description" content="" />
  7. <link href="default.css" rel="stylesheet" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="header">
  11.     <div id="logo">
  12.         <h1><a href="#">Advantage</a></h1></div>
  13.  
  14.     <div id="menu">
  15.         <ul>
  16.             <li class="active"><a href="#" title="">Homepage</a></li>
  17.             <li><a href="#" title="">About Us</a></li>
  18.             <li><a href="#" title="">Products</a></li>
  19.             <li><a href="#" title="">Clients</a></li>
  20.             <li><a href="#" title="">Support</a></li>
  21.         </ul>
  22.     </div>
  23. </div>
  24. <div id="content">
  25.     <div id="sidebar">
  26.         <div id="login" class="boxed">
  27.             <h2 class="title">Client AccounT<a href="login.php"> LOGIN </a></h2>
  28.         </div>
  29.         <div id="updates" class="boxed">
  30.         <h2 class="title">Recent Updates</h2>
  31.             <div class="content">
  32.                 <ul>
  33.                     <li>
  34.                         <h3>March 5, 2007</h3>
  35.                         <p><a href="#">In posuere eleifend odio quisque semper augue mattis wisi maecenas ligula…</a></p>
  36.                     </li>
  37.                     <li>
  38.                         <h3>March 3, 2007</h3>
  39.                         <p><a href="#">Quisque dictum integer nisl risus, sagittis convallis, rutrum id, congue, and nibh…</a></p>
  40.                     </li>
  41.                     <li>
  42.                         <h3>February 28, 2007</h3>
  43.                         <p><a href="#">Donec leo, vivamus fermentum nibh in augue praesent a lacus at urna congue rutrum…</a></p>
  44.                     </li>
  45.                     <li>
  46.                         <h3>February 25, 2007</h3>
  47.                         <p><a href="#">Nam pede erat, porta eu, lobortis eget, tempus et, tellus. Etiam nequea…</a></p>
  48.                     </li>
  49.                     <li>
  50.                         <h3>February 20, 2007</h3>
  51.                         <p><a href="#">Vivamus fermentum nibh in augue. Praesent a lacus at urna congue rutrum. Nulla enim eros…</a></p>
  52.                     </li>
  53.                 </ul>
  54.             </div>
  55.         </div>
  56.     </div>
  57.     <div id="main">
  58.         <div id="welcome" class="post">
  59.             <h2 class="title">Welcome to Advantage!</h2>
  60.             <h3 class="date"><span class="month">Mar.</span> <span class="day">8</span><span class="year">, 2007</span></h3>
  61.             <div class="story">
  62.               <p><?PHP
  63. require_once("./include/membersite_config.php");
  64.  
  65. if(isset($_POST['submitted']))
  66. {
  67.    if($fgmembersite->Login())
  68.    {
  69.         $fgmembersite->RedirectToURL("login-home.php");
  70.    }
  71. }
  72.  
  73. ?>
  74.   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  75.   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
  76.   <head>
  77.                 <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
  78.                 <title>Login</title>
  79.                 <link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css" />
  80.                 <script type='text/javascript' src='scripts/gen_validatorv31.js'></script>
  81.   </head>
  82.   <body>
  83.  
  84.   <!-- Form Code Start -->
  85. <div id='fg_membersite'>
  86. <form id='login' action='<?php echo $fgmembersite->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
  87. <fieldset >
  88. <legend>Login</legend>
  89.  
  90. <input type='hidden' name='submitted' id='submitted' value='1'/>
  91.  
  92. <div class='short_explanation'>* required fields</div>
  93.  
  94. <div><span class='error'><?php echo $fgmembersite->GetErrorMessage(); ?></span></div>
  95. <div class='container'>
  96.     <label for='username' >UserName*:</label><br/>
  97.     <input type='text' name='username' id='username' value='<?php echo $fgmembersite->SafeDisplay('username') ?>' maxlength="50" /><br/>
  98.     <span id='login_username_errorloc' class='error'></span>
  99. </div>
  100. <div class='container'>
  101.     <label for='password' >Password*:</label><br/>
  102.     <input type='password' name='password' id='password' maxlength="50" /><br/>
  103.     <span id='login_password_errorloc' class='error'></span>
  104. </div>
  105.  
  106. <div class='container'>
  107.     <input type='submit' name='Submit' value='Submit' />
  108. </div>
  109. <div class='short_explanation'><a href='reset-pwd-req.php'>Forgot Password?</a></div>
  110. </fieldset>
  111. </form>
  112. <!-- client-side Form Validations:
  113. Uses the excellent form validation script from JavaScript-coder.com-->
  114.  
  115. <script type='text/javascript'>
  116. // <![CDATA[
  117.  
  118.     var frmvalidator  = new Validator("login");
  119.     frmvalidator.EnableOnPageErrorDisplay();
  120.     frmvalidator.EnableMsgsTogether();
  121.  
  122.     frmvalidator.addValidation("username","req","Please provide your username");
  123.  
  124.     frmvalidator.addValidation("password","req","Please provide the password");
  125.  
  126. // ]]>
  127. </script>
  128. </div>
  129. <!--
  130. Form Code End (see html-form-guide.com for more info.)
  131. -->
  132.  
  133.  
  134.         </div>
  135.             <div class="meta">
  136.                 <p>Posted by Jane Anderson under <a href="#">Uncategorized</a>, <a href="#">Daily Journal</a><br />
  137.                     <a href="#">Trackback URI</a> | <a href="#">No Comments</a> | <a href="#">Permalink</a></p>
  138.             </div>
  139.         </div>
  140.         <div id="example" class="post">
  141.             <h2 class="title">Examples of Common Tags</h2>
  142.             <h3 class="date"><span class="month">Feb.</span> <span class="day">24</span><span class="year">, 2007</span></h3>
  143.             <div class="story">
  144.                 <p>This is an example of a paragraph followed by a blockquote:</p>
  145.                 <blockquote>
  146.                     <p>&ldquo;Pellentesque tristique ante ut  risus. Quisque dictum. Integer nisl risus, sagittis convallis, rutrum  id, elementum congue, nibh. Suspendisse dictum porta lectus. Donec  placerat odio.&rdquo;</p>
  147.                 </blockquote>
  148.                 <h3>Heading Level Three</h3>
  149.                 <p>This is another example of a paragraph followed by an unordered list:</p>
  150.                 <p>An ordered list example:</p>
  151.                 <ol>
  152.                     <li>List item number one</li>
  153.                     <li>List item number two</li>
  154.                     <li>List item number thre</li>
  155.                 </ol>
  156.             </div>
  157.             <div class="meta">
  158.                 <p>Posted by Jane Anderson under <a href="#">Samples</a><br />
  159.                     <a href="#">Trackback URI</a> | <a href="#">No Comments</a> | <a href="#">Permalink</a></p>
  160.             </div>
  161.         </div>
  162.     </div>
  163. </div>
  164. <div id="footer">
  165.     <p id="legal">Copyright &copy; 2007 Advantage. All Rights Reserved. Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
  166.     <p id="links"><a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a></p>
  167. </div>
  168. </body>
  169. </html>
Apr 18 '12 #1
Share this Question
Share on Google+
3 Replies


100+
P: 1,059
your warning explains everything,
when a server response to client(browser), it sends two types of data
1. header
2. data for browser

header must have to send first and after you send one byte of data you cant send anymore header.

in your case i can guess that your session_start is probably in membersite_config.php file. declare the file at the top of the page. e.g.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once(....);
  3. ?>
  4. <html>
  5. ......
  6. </html>
  7.  
Apr 18 '12 #2

P: 2
<?php ob_start() ?> the another option
May 8 '12 #3

Dormilich
Expert Mod 5K+
P: 8,639
@Rockwood: thatís only fixing the symptoms. the real cause (insufficient design) still remains.
May 9 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.