ERROR Message Warning: session_start()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • myxenex
    New Member
    • Apr 2012
    • 1

    ERROR Message Warning: session_start()

    I GET THE ERROR MESSAGE:
    Warning: session_start() [function.sessio n-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.p hp on line 137




    BELOW is my PHP script do i do something wrong?
    Please help.
    Code:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Welcome</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link href="default.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="header">
    	<div id="logo">
    		<h1><a href="#">Advantage</a></h1></div>
    	
        <div id="menu">
    		<ul>
    			<li class="active"><a href="#" title="">Homepage</a></li>
    			<li><a href="#" title="">About Us</a></li>
    			<li><a href="#" title="">Products</a></li>
    			<li><a href="#" title="">Clients</a></li>
    			<li><a href="#" title="">Support</a></li>
    		</ul>
    	</div>
    </div>
    <div id="content">
    	<div id="sidebar">
    		<div id="login" class="boxed">
    			<h2 class="title">Client AccounT<a href="login.php"> LOGIN </a></h2>
    		</div>
    		<div id="updates" class="boxed">
    	    <h2 class="title">Recent Updates</h2>
    			<div class="content">
    				<ul>
    					<li>
    						<h3>March 5, 2007</h3>
    						<p><a href="#">In posuere eleifend odio quisque semper augue mattis wisi maecenas ligula…</a></p>
    					</li>
    					<li>
    						<h3>March 3, 2007</h3>
    						<p><a href="#">Quisque dictum integer nisl risus, sagittis convallis, rutrum id, congue, and nibh…</a></p>
    					</li>
    					<li>
    						<h3>February 28, 2007</h3>
    						<p><a href="#">Donec leo, vivamus fermentum nibh in augue praesent a lacus at urna congue rutrum…</a></p>
    					</li>
    					<li>
    						<h3>February 25, 2007</h3>
    						<p><a href="#">Nam pede erat, porta eu, lobortis eget, tempus et, tellus. Etiam nequea…</a></p>
    					</li>
    					<li>
    						<h3>February 20, 2007</h3>
    						<p><a href="#">Vivamus fermentum nibh in augue. Praesent a lacus at urna congue rutrum. Nulla enim eros…</a></p>
    					</li>
    				</ul>
    			</div>
    		</div>
    	</div>
    	<div id="main">
    		<div id="welcome" class="post">
    			<h2 class="title">Welcome to Advantage!</h2>
    			<h3 class="date"><span class="month">Mar.</span> <span class="day">8</span><span class="year">, 2007</span></h3>
    			<div class="story">
    			  <p><?PHP
    require_once("./include/membersite_config.php");
    
    if(isset($_POST['submitted']))
    {
       if($fgmembersite->Login())
       {
            $fgmembersite->RedirectToURL("login-home.php");
       }
    }
    
    ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
      <head>
    			    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
    			    <title>Login</title>
    			    <link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css" />
    			    <script type='text/javascript' src='scripts/gen_validatorv31.js'></script>
      </head>
      <body>
    			    
      <!-- Form Code Start -->
    <div id='fg_membersite'>
    <form id='login' action='<?php echo $fgmembersite->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
    <fieldset >
    <legend>Login</legend>
    
    <input type='hidden' name='submitted' id='submitted' value='1'/>
    
    <div class='short_explanation'>* required fields</div>
    
    <div><span class='error'><?php echo $fgmembersite->GetErrorMessage(); ?></span></div>
    <div class='container'>
        <label for='username' >UserName*:</label><br/>
        <input type='text' name='username' id='username' value='<?php echo $fgmembersite->SafeDisplay('username') ?>' maxlength="50" /><br/>
        <span id='login_username_errorloc' class='error'></span>
    </div>
    <div class='container'>
        <label for='password' >Password*:</label><br/>
        <input type='password' name='password' id='password' maxlength="50" /><br/>
        <span id='login_password_errorloc' class='error'></span>
    </div>
    
    <div class='container'>
        <input type='submit' name='Submit' value='Submit' />
    </div>
    <div class='short_explanation'><a href='reset-pwd-req.php'>Forgot Password?</a></div>
    </fieldset>
    </form>
    <!-- client-side Form Validations:
    Uses the excellent form validation script from JavaScript-coder.com-->
    
    <script type='text/javascript'>
    // <![CDATA[
    
        var frmvalidator  = new Validator("login");
        frmvalidator.EnableOnPageErrorDisplay();
        frmvalidator.EnableMsgsTogether();
    
        frmvalidator.addValidation("username","req","Please provide your username");
        
        frmvalidator.addValidation("password","req","Please provide the password");
    
    // ]]>
    </script>
    </div>
    <!--
    Form Code End (see html-form-guide.com for more info.)
    -->
    
    
    	    </div>
    			<div class="meta">
    				<p>Posted by Jane Anderson under <a href="#">Uncategorized</a>, <a href="#">Daily Journal</a><br />
    					<a href="#">Trackback URI</a> | <a href="#">No Comments</a> | <a href="#">Permalink</a></p>
    			</div>
    		</div>
    		<div id="example" class="post">
    			<h2 class="title">Examples of Common Tags</h2>
    			<h3 class="date"><span class="month">Feb.</span> <span class="day">24</span><span class="year">, 2007</span></h3>
    			<div class="story">
    				<p>This is an example of a paragraph followed by a blockquote:</p>
    				<blockquote>
    					<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>
    				</blockquote>
    				<h3>Heading Level Three</h3>
    				<p>This is another example of a paragraph followed by an unordered list:</p>
    				<p>An ordered list example:</p>
    				<ol>
    					<li>List item number one</li>
    					<li>List item number two</li>
    					<li>List item number thre</li>
    				</ol>
    			</div>
    			<div class="meta">
    				<p>Posted by Jane Anderson under <a href="#">Samples</a><br />
    					<a href="#">Trackback URI</a> | <a href="#">No Comments</a> | <a href="#">Permalink</a></p>
    			</div>
    		</div>
    	</div>
    </div>
    <div id="footer">
    	<p id="legal">Copyright &copy; 2007 Advantage. All Rights Reserved. Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
    	<p id="links"><a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a></p>
    </div>
    </body>
    </html>
    Last edited by Dormilich; May 9 '12, 05:16 AM. Reason: Please use [CODE] [/CODE] tags when posting code.
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    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_conf ig.php file. declare the file at the top of the page. e.g.
    Code:
    <?php
    require_once(....);
    ?>
    <html>
    ......
    </html>

    Comment

    • Rockwood
      New Member
      • May 2012
      • 2

      #3
      <?php ob_start() ?> the another option

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        @Rockwood: that’s only fixing the symptoms. the real cause (insufficient design) still remains.

        Comment

        Working...