Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts

    I just downloaded a script...could someone help debug it?

    There seem to be some problems with this script...can anyone figure out how to fix them? (They're not too big)

    First:
    This page: (admin.php)
    PHP Code:
    <?php
    include("include.php");
    session_start();
    if (@
    $_SESSION['loggedin'] == 1){
        
    ?>
        You are currently loggedin.<br>
        You will automatically be logged out if you return to the SMS main page.<br>
        You may select a sorting pattern or click submit to view messages with default sorting.<br><br>
        <form action="messages.php" method="post">
              <input type='checkbox' name="sortbyname">
              sort by name 
              <input type='checkbox' name="sortbydate">
              sort by date <br />
              <br />
              <input type='submit' name="passsubmit" value="SUBMIT" />
            </p>
          </form><br>
    <?php
    echo "<p><a href='sms3.php'>Click here to logout</a></p>";
    }else{
        
    ?>
    Gives me:
    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at include.php:58) in admin.php on line 3

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at include.php:58) in admin.php on line 3
    and here's lines 50-65 in include.php:
    PHP Code:
        $pagenext $_REQUEST['pagenext'];
        
    $pageprev $_REQUEST['pageprev'];
        
    $REMOTE_ADDR $_SERVER['REMOTE_ADDR'];
        
    $PHP_SELF $_SERVER['PHP_SELF'];    
    ?>
    <!-- Header data -->
    <HTML>
    <HEAD>
    <script type="text/javascript" src="/overlibmws/overlibmws.js"></script>
    <title>Simple Message System 3.0</title>
    <SCRIPT LANGUAGE="Javascript">
    <!---
    function decision(message, url){
    if(confirm(message)) location.href = url;
    }
    // ---> 

  • #2
    New to the CF scene
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Crazydog View Post


    (admin.php)
    PHP Code:
    <?php
    session_start
    ();
    include(
    "include.php");
    looks like the error is because the header is sent before the session is started.
    switching those lines should fix it if I'm not mistaken.

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts
    that fixed it...and the other problem was caused by a comment..
    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •