including file and output to browser

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

    #1

    including file and output to browser

    I am not sure I understand the rules as to what exactly gets output to a
    browser and when. If I include a text only file or an html file, these will
    show up in the browser regardless of where in the script they are included.

    Thanks,
    Mike



    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
  • Michael Phipps

    #2
    Re: including file and output to browser

    >I am not sure I understand the rules as to what exactly gets output to a[color=blue]
    >browser and when.[/color]

    To make things easier, lets assume you aren't using output buffering.

    a PHP file gets read top to bottom.

    If while reading one PHP file the parser comes across an included file, that
    file will be read top to bottom and then continue from where it left off in
    the original script.
    [color=blue]
    > If I include a text only file or an html file, these will show up in the
    > browser regardless of where in the script they are included.[/color]

    They will be output to the browser at whatever point you put them in the
    script.

    Why do you ask anyhow? Some code might make it easier to explain why you
    are experiencing a particular problem.

    Michael


    Comment

    • Michael G

      #3
      Re: including file and output to browser


      "Michael Phipps" <gravityspike_s pamfree_@optusn et.com.au> wrote in message
      news:42eb0b77$0 $18132$afc38c87 @news.optusnet. com.au...[color=blue]
      > Why do you ask anyhow? Some code might make it easier to explain why you
      > are experiencing a particular problem.
      >[/color]

      Well, my web applications are starting to more like standalone apps because
      I have been using OO and the web version of MVC. Each request involves a
      number of objects, so to the reader it doesn't look like a single script,
      yet it is. Since MVC does such a nice job of separation, the template that
      actually gets pushed out to the browser is an 'include' in a method call in
      a View/Template class.

      Mike



      ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
      http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
      ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

      Comment

      Working...