Header Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anis2007
    New Member
    • Oct 2006
    • 21

    #1

    Header Problem

    Hi every one, Plz help me hurry.

    Actualy problem is this:
    my whole website is running in a right way our company server.
    but this website not run in the client server, and show this message, when we login and go the next page.
    error is:

    Warning: Cannot send session cache limiter - headers already sent (output started at c:\apache\htdoc s\medscout\www\ connection.php: 1) in c:\apache\htdoc s\medscout\www\ my-medscout.php on line 5

    but when we used @ before session.
    like: @session_start( );
    then above warning is reduce and when we logout then show this warning.

    Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdoc s\medscout\www\ connection.php: 1) in c:\apache\htdoc s\medscout\www\ logout.php on line 7

    and log out code is this:
    <?php
    include_once("c onnection.php") ;
    @session_start( );
    $_SESSION["username"]="";
    $_SESSION["uid"]="";
    session_destroy ();
    header("Locatio n:index.php");
    ?>

    Thankyou
    Regards
    Anis
  • uinoma
    New Member
    • Oct 2006
    • 5

    #2
    can you give me detail of the code and where is the problem really found out?
    on login or on log out

    becouse you just give me the log out code

    Comment

    • vssp
      Contributor
      • Jul 2006
      • 268

      #3
      Hai plase check any html code befor tthe header?

      If any html code available getting the problem

      vp

      Comment

      • bevort
        New Member
        • Jul 2006
        • 53

        #4
        Originally posted by anis2007
        Hi every one, Plz help me hurry.

        Warning: Cannot send session cache limiter - headers already sent (output started at c:\apache\htdoc s\medscout\www\ connection.php: 1) in c:\apache\htdoc s\medscout\www\ my-medscout.php on line 5

        but when we used @ before session.
        like: @session_start( );
        then above warning is reduce and when we logout then show this warning.

        Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdoc s\medscout\www\ connection.php: 1) in c:\apache\htdoc s\medscout\www\ logout.php on line 7

        and log out code is this:
        <?php
        include_once("c onnection.php") ;
        @session_start( );
        $_SESSION["username"]="";
        $_SESSION["uid"]="";
        session_destroy ();
        header("Locatio n:index.php");
        ?>

        Thankyou
        Regards
        Anis
        Move the Session_start() to the top of your page anyway.
        But that will not solve the problem i think.

        You are sure that the code works because it works on your server. You have to make sure the the new (customer) server understands your code.
        Compare your servers PHP.ini against the customers. You will probable find differances in the session part.
        Make sure that the session temp dit realy exists. this is case and slash direcion sencitive depending on the server. Do not use \ if the server expects /

        Comment

        • sungaly
          New Member
          • Oct 2006
          • 1

          #5
          <?php
          ob_start();
          session_start() ;
          include_once("c onnection.php") ;
          $_SESSION["username"]="";
          $_SESSION["uid"]="";
          session_destroy ();
          header("Locatio n:index.php");
          ?>
          use now...It`ll work
          Why you are using destroy here...what purpose???

          Comment

          Working...