Unexpected Absence of Expected Warning.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • geevaa

    #1

    Unexpected Absence of Expected Warning.

    Hi Group,
    The page 167 of book Learning PHP5 by David Sklar says that
    setcookie() and session_start() must be added before any output.
    I tried to use that functions at last line but no warning!.
    The warning which i got 1 month back is not issued now.
    ------------------------------------------------------------------
    The following is my PHP program
    <?php

    function Intelli()
    {
    echo"Hello P";
    }

    function Bitz()
    {
    echo"Hello MySQL";
    }

    ;
    $a = 1;
    if($a)
    $myFunc = 'Intelli';
    else
    $myFunc ='Bitz';

    $myFunc();
    print'header';

    session_start() ;
    setcookie('user id')
    ?>

    ----------------------------------------------------------------
    The following is the output i got.
    There is no warning

    [tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
    X-Powered-By: PHP/5.2.0
    Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
    Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
    check=0
    Pragma: no-cache
    Set-Cookie: userid=
    Content-type: text/html

    Hello Pheader
    -------------------------------------------------------------

    can any one explain why i din get the warning.....

    Also please refer the following link,



    thanks

  • Rami Elomaa

    #2
    Re: Unexpected Absence of Expected Warning.

    "geevaa" <govivasanth@gm ail.comwrote in message
    news:1177485085 .994168.313590@ n35g2000prd.goo glegroups.com.. .
    Hi Group,
    The page 167 of book Learning PHP5 by David Sklar says that
    setcookie() and session_start() must be added before any output.
    I tried to use that functions at last line but no warning!.
    The warning which i got 1 month back is not issued now.
    ------------------------------------------------------------------
    The following is my PHP program
    <?php
    >
    function Intelli()
    {
    echo"Hello P";
    }
    >
    function Bitz()
    {
    echo"Hello MySQL";
    }
    >
    ;
    $a = 1;
    if($a)
    $myFunc = 'Intelli';
    else
    $myFunc ='Bitz';
    >
    $myFunc();
    print'header';
    >
    session_start() ;
    setcookie('user id')
    ?>
    >
    ----------------------------------------------------------------
    The following is the output i got.
    There is no warning
    >
    [tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
    X-Powered-By: PHP/5.2.0
    Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
    Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
    check=0
    Pragma: no-cache
    Set-Cookie: userid=
    Content-type: text/html
    >
    Hello Pheader
    -------------------------------------------------------------
    >
    can any one explain why i din get the warning.....

    Output buffering on by default?

    echo ini_get('output _buffering');


    --
    Rami.Elomaa@gma il.com

    "Good tea. Nice house." -- Worf


    Comment

    • geevaa

      #3
      Re: Unexpected Absence of Expected Warning.

      On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
      "geevaa" <govivasa...@gm ail.comwrote in message
      >
      news:1177485085 .994168.313590@ n35g2000prd.goo glegroups.com.. .
      >
      >
      >
      Hi Group,
      The page 167 of book Learning PHP5 by David Sklar says that
      setcookie() and session_start() must be added before any output.
      I tried to use that functions at last line but no warning!.
      The warning which i got 1 month back is not issued now.
      ------------------------------------------------------------------
      The following is my PHP program
      <?php
      >
      function Intelli()
      {
      echo"Hello P";
      }
      >
      function Bitz()
      {
      echo"Hello MySQL";
      }
      >
      ;
      $a = 1;
      if($a)
      $myFunc = 'Intelli';
      else
      $myFunc ='Bitz';
      >
      $myFunc();
      print'header';
      >
      session_start() ;
      setcookie('user id')
      ?>
      >
      ----------------------------------------------------------------
      The following is the output i got.
      There is no warning
      >
      [tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
      X-Powered-By: PHP/5.2.0
      Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
      Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
      Expires: Thu, 19 Nov 1981 08:52:00 GMT
      Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
      check=0
      Pragma: no-cache
      Set-Cookie: userid=
      Content-type: text/html
      >
      Hello Pheader
      -------------------------------------------------------------
      >
      can any one explain why i din get the warning.....
      >
      Output buffering on by default?
      >
      echo ini_get('output _buffering');
      >
      --
      Rami.Elo...@gma il.com
      >
      "Good tea. Nice house." -- Worf
      my php coding is

      <?php

      echo ini_get('output _buffering');

      ?>

      My output is

      [tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
      X-Powered-By: PHP/5.2.0
      Content-type: text/html

      4096

      thanks

      Comment

      • Rami Elomaa

        #4
        Re: Unexpected Absence of Expected Warning.

        "geevaa" <govivasanth@gm ail.comwrote in message
        news:1178079630 .877693.308390@ h2g2000hsg.goog legroups.com...
        On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
        >"geevaa" <govivasa...@gm ail.comwrote in message
        >>
        >news:117748508 5.994168.313590 @n35g2000prd.go oglegroups.com. ..
        >>
        >>
        >>
        Hi Group,
        The page 167 of book Learning PHP5 by David Sklar says that
        setcookie() and session_start() must be added before any output.
        I tried to use that functions at last line but no warning!.
        The warning which i got 1 month back is not issued now.
        ------------------------------------------------------------------
        The following is my PHP program
        <?php
        >>
        function Intelli()
        {
        echo"Hello P";
        }
        >>
        function Bitz()
        {
        echo"Hello MySQL";
        }
        >>
        ;
        $a = 1;
        if($a)
        $myFunc = 'Intelli';
        else
        $myFunc ='Bitz';
        >>
        $myFunc();
        print'header';
        >>
        session_start() ;
        setcookie('user id')
        ?>
        >>
        ----------------------------------------------------------------
        The following is the output i got.
        There is no warning
        >>
        [tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
        X-Powered-By: PHP/5.2.0
        Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
        Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
        Expires: Thu, 19 Nov 1981 08:52:00 GMT
        Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
        check=0
        Pragma: no-cache
        Set-Cookie: userid=
        Content-type: text/html
        >>
        Hello Pheader
        -------------------------------------------------------------
        >>
        can any one explain why i din get the warning.....
        >>
        >Output buffering on by default?
        >>
        >echo ini_get('output _buffering');
        >>
        >--
        >Rami.Elo...@gm ail.com
        >>
        >"Good tea. Nice house." -- Worf
        my php coding is
        >
        <?php
        >
        echo ini_get('output _buffering');
        >
        ?>
        >
        My output is
        >
        [tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
        X-Powered-By: PHP/5.2.0
        Content-type: text/html
        >
        4096

        Well it's on then, since it returns the buffer size. The body, ie. output is
        sent only when the script exits so that's why you get no warning.

        --
        Rami.Elomaa@gma il.com

        "Good tea. Nice house." -- Worf


        Comment

        • geevaa

          #5
          Re: Unexpected Absence of Expected Warning.

          On May 2, 11:13 am, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
          "geevaa" <govivasa...@gm ail.comwrote in message
          >
          news:1178079630 .877693.308390@ h2g2000hsg.goog legroups.com...
          >
          >
          >
          On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
          "geevaa" <govivasa...@gm ail.comwrote in message
          >
          >news:117748508 5.994168.313590 @n35g2000prd.go oglegroups.com. ..
          >
          Hi Group,
          The page 167 of book Learning PHP5 by David Sklar says that
          setcookie() and session_start() must be added before any output.
          I tried to use that functions at last line but no warning!.
          The warning which i got 1 month back is not issued now.
          ------------------------------------------------------------------
          The following is my PHP program
          <?php
          >
          function Intelli()
          {
          echo"Hello P";
          }
          >
          function Bitz()
          {
          echo"Hello MySQL";
          }
          >
          ;
          $a = 1;
          if($a)
          $myFunc = 'Intelli';
          else
          $myFunc ='Bitz';
          >
          $myFunc();
          print'header';
          >
          session_start() ;
          setcookie('user id')
          ?>
          >
          ----------------------------------------------------------------
          The following is the output i got.
          There is no warning
          >
          [tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
          X-Powered-By: PHP/5.2.0
          Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
          Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
          Expires: Thu, 19 Nov 1981 08:52:00 GMT
          Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
          check=0
          Pragma: no-cache
          Set-Cookie: userid=
          Content-type: text/html
          >
          Hello Pheader
          -------------------------------------------------------------
          >
          can any one explain why i din get the warning.....
          >
          Output buffering on by default?
          >
          echo ini_get('output _buffering');
          >
          --
          Rami.Elo...@gma il.com
          >
          "Good tea. Nice house." -- Worf
          my php coding is
          >
          <?php
          >
          echo ini_get('output _buffering');
          >
          ?>
          >
          My output is
          >
          [tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
          X-Powered-By: PHP/5.2.0
          Content-type: text/html
          >
          4096
          >
          Well it's on then, since it returns the buffer size. The body, ie. output is
          sent only when the script exits so that's why you get no warning.
          >
          --
          Rami.Elo...@gma il.com
          >
          "Good tea. Nice house." -- Worf
          Dear rami,

          you wan me to use ini_set() to off it. ?
          you wan me to make some changes in php.ini ?

          Comment

          • Rami Elomaa

            #6
            Re: Unexpected Absence of Expected Warning.

            "geevaa" <govivasanth@gm ail.comwrote in message
            news:1178092487 .521002.297290@ o5g2000hsb.goog legroups.com...
            On May 2, 11:13 am, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
            >"geevaa" <govivasa...@gm ail.comwrote in message
            >>
            >news:117807963 0.877693.308390 @h2g2000hsg.goo glegroups.com.. .
            >>
            >>
            >>
            On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
            >"geevaa" <govivasa...@gm ail.comwrote in message
            >>
            >>news:11774850 85.994168.31359 0@n35g2000prd.g ooglegroups.com ...
            >>
            Hi Group,
            The page 167 of book Learning PHP5 by David Sklar says that
            setcookie() and session_start() must be added before any output.
            I tried to use that functions at last line but no warning!.
            The warning which i got 1 month back is not issued now.
            ------------------------------------------------------------------
            The following is my PHP program
            <?php
            >>
            function Intelli()
            {
            echo"Hello P";
            }
            >>
            function Bitz()
            {
            echo"Hello MySQL";
            }
            >>
            ;
            $a = 1;
            if($a)
            $myFunc = 'Intelli';
            else
            $myFunc ='Bitz';
            >>
            $myFunc();
            print'header';
            >>
            session_start() ;
            setcookie('user id')
            ?>
            >>
            ----------------------------------------------------------------
            The following is the output i got.
            There is no warning
            >>
            [tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
            X-Powered-By: PHP/5.2.0
            Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
            Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
            Expires: Thu, 19 Nov 1981 08:52:00 GMT
            Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
            pre-
            check=0
            Pragma: no-cache
            Set-Cookie: userid=
            Content-type: text/html
            >>
            Hello Pheader
            -------------------------------------------------------------
            >>
            can any one explain why i din get the warning.....
            >>
            >Output buffering on by default?
            >>
            >echo ini_get('output _buffering');
            >>
            >--
            >Rami.Elo...@gm ail.com
            >>
            >"Good tea. Nice house." -- Worf
            my php coding is
            >>
            <?php
            >>
            echo ini_get('output _buffering');
            >>
            ?>
            >>
            My output is
            >>
            [tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
            X-Powered-By: PHP/5.2.0
            Content-type: text/html
            >>
            4096
            >>
            >Well it's on then, since it returns the buffer size. The body, ie. output
            >is
            >sent only when the script exits so that's why you get no warning.
            >>
            >--
            >Rami.Elo...@gm ail.com
            >>
            >"Good tea. Nice house." -- Worf
            >
            Dear rami,
            >
            you wan me to use ini_set() to off it. ?
            you wan me to make some changes in php.ini ?
            >
            I'm not telling you to do anything. You wondered why there was no error
            message, and the reason is that your php is configured to buffer output.
            It's up to you to decide what to do with this information.

            --
            Rami.Elomaa@gma il.com

            "Good tea. Nice house." -- Worf


            Comment

            • geevaa

              #7
              Re: Unexpected Absence of Expected Warning.

              On May 2, 1:06 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
              "geevaa" <govivasa...@gm ail.comwrote in message
              >
              news:1178092487 .521002.297290@ o5g2000hsb.goog legroups.com...
              >
              >
              >
              On May 2, 11:13 am, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
              "geevaa" <govivasa...@gm ail.comwrote in message
              >
              >news:117807963 0.877693.308390 @h2g2000hsg.goo glegroups.com.. .
              >
              On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
              "geevaa" <govivasa...@gm ail.comwrote in message
              >
              >news:117748508 5.994168.313590 @n35g2000prd.go oglegroups.com. ..
              >
              Hi Group,
              The page 167 of book Learning PHP5 by David Sklar says that
              setcookie() and session_start() must be added before any output.
              I tried to use that functions at last line but no warning!.
              The warning which i got 1 month back is not issued now.
              ------------------------------------------------------------------
              The following is my PHP program
              <?php
              >
              function Intelli()
              {
              echo"Hello P";
              }
              >
              function Bitz()
              {
              echo"Hello MySQL";
              }
              >
              ;
              $a = 1;
              if($a)
              $myFunc = 'Intelli';
              else
              $myFunc ='Bitz';
              >
              $myFunc();
              print'header';
              >
              session_start() ;
              setcookie('user id')
              ?>
              >
              ----------------------------------------------------------------
              The following is the output i got.
              There is no warning
              >
              [tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
              X-Powered-By: PHP/5.2.0
              Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
              Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
              Expires: Thu, 19 Nov 1981 08:52:00 GMT
              Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
              pre-
              check=0
              Pragma: no-cache
              Set-Cookie: userid=
              Content-type: text/html
              >
              Hello Pheader
              -------------------------------------------------------------
              >
              can any one explain why i din get the warning.....
              >
              Output buffering on by default?
              >
              echo ini_get('output _buffering');
              >
              --
              Rami.Elo...@gma il.com
              >
              "Good tea. Nice house." -- Worf
              my php coding is
              >
              <?php
              >
              echo ini_get('output _buffering');
              >
              ?>
              >
              My output is
              >
              [tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
              X-Powered-By: PHP/5.2.0
              Content-type: text/html
              >
              4096
              >
              Well it's on then, since it returns the buffer size. The body, ie. output
              is
              sent only when the script exits so that's why you get no warning.
              >
              --
              Rami.Elo...@gma il.com
              >
              "Good tea. Nice house." -- Worf
              >
              Dear rami,
              >
              you wan me to use ini_set() to off it. ?
              you wan me to make some changes in php.ini ?
              >
              I'm not telling you to do anything. You wondered why there was no error
              message, and the reason is that your php is configured to buffer output.
              It's up to you to decide what to do with this information.
              >
              --
              Rami.Elo...@gma il.com
              >
              "Good tea. Nice house." -- Worf
              Dear Rami,

              Thanks for your explanation

              I am now working on how to set the output_bufferin g to the default
              value of 0.


              Comment

              Working...