PHP and FRAMES?

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

    PHP and FRAMES?

    Hi All,
    I'm developing a website which incorporates a header section at the top,
    side areas and a central area. If I was developing the site with straight
    HTML, I'd simply use FRAMES. However, by using PHP I thought I'd be able to
    get around this as I use a single PHP to decide what information should be
    present in each area of the page and render it appropriately. However, I
    also need to incorporate 3rd party HTML files into the centre section/area
    of my page. As these files include the full HTML page contents ie. with
    <BODY> and <HEAD> tags I'm wondering how best to do this.
    As far as I can see, the only way I can do this is to incorporate frames
    into my PHP code. Without altering the contents of the 3rd party html files,
    is there any other way of doing this?.

    If I do have to have frames, what is the best method for integrating them
    with the PHP code?. Would you have seprate PHP scripts in each frame, or
    would you have a single script that is capable of generating each frame
    depending on variables past to it (and extracted using $_GET{}?).

    Any comments gratefully recieved.

    Ta,
    Dave



  • Beauregard T. Shagnasty

    #2
    Re: PHP and FRAMES?

    Dave Moore wrote:[color=blue]
    > Hi All, I'm developing a website which incorporates a header
    > section at the top, side areas and a central area. If I was
    > developing the site with straight HTML, I'd simply use FRAMES.[/color]

    Google for: frames are evil

    Then, look at some simple HTML for a typical three-column page.


    You can output the HTML with your PHP code, of course.

    --
    -bts
    -This space intentionally left blank.

    Comment

    • chotiwallah

      #3
      Re: PHP and FRAMES?

      well, you'd have to strip out the header and body tag from the 3rd
      party pages.

      read the page into a string, looks something like that:

      <html>
      <head>
      //head content
      </head>
      <body>
      //body content
      </body>
      <html>

      you're interested in anything between the body tags.
      you could use some regex to extract anything between <body (note the
      missing >, there might be style information) and </body>.
      i'm not an expert on regex, but it could be formulated to find text
      between the body tags, but excluding the tags itself. maybe post it as
      a question here.

      but: you would quite likely stripping out their css and javascript too,
      which is likely to be in the head section. no problem with css, class
      attributes are just ignored if no stylesheet is present, but you could
      be looking at a lot of javascript errors that way.

      micha

      Comment

      • Five Cats

        #4
        Re: PHP and FRAMES?

        In message <p%Rhe.35104$ia 6.20508@twister .nyroc.rr.com>, Beauregard T.
        Shagnasty <a.nony.mous@ex ample.invalid> writes[color=blue]
        >Dave Moore wrote:[color=green]
        >> Hi All, I'm developing a website which incorporates a header
        >> section at the top, side areas and a central area. If I was
        >> developing the site with straight HTML, I'd simply use FRAMES.[/color]
        >
        >Google for: frames are evil
        >
        >Then, look at some simple HTML for a typical three-column page.
        >http://www.benmeadowcroft.com/webdev.../3-column.html
        >
        >You can output the HTML with your PHP code, of course.[/color]

        He will still have the same problem even if there are no frames in the
        output - he wants to incorporate outside files that include <HEAD> and
        so on.[color=blue]
        >[/color]

        --
        Five Cats
        Email to: cats_spam at uk2 dot net

        Comment

        • Tom Scales

          #5
          Re: PHP and FRAMES?


          "Five Cats" <cats_spam@[127.0.0.1]> wrote in message
          news:n8$EYPAdzZ iCFwUa@[127.0.0.1]...[color=blue]
          > In message <p%Rhe.35104$ia 6.20508@twister .nyroc.rr.com>, Beauregard T.
          > Shagnasty <a.nony.mous@ex ample.invalid> writes[color=green]
          >>Dave Moore wrote:[color=darkred]
          >>> Hi All, I'm developing a website which incorporates a header
          >>> section at the top, side areas and a central area. If I was
          >>> developing the site with straight HTML, I'd simply use FRAMES.[/color]
          >>
          >>Google for: frames are evil
          >>
          >>Then, look at some simple HTML for a typical three-column page.
          >>http://www.benmeadowcroft.com/webdev.../3-column.html
          >>
          >>You can output the HTML with your PHP code, of course.[/color]
          >
          > He will still have the same problem even if there are no frames in the
          > output - he wants to incorporate outside files that include <HEAD> and so
          > on.[color=green]
          >>[/color]
          >
          > --
          > Five Cats
          > Email to: cats_spam at uk2 dot net[/color]

          Why not just imbed an IFRAME? I use them in my PHP generated code and
          include other HTML files. Works fine.

          Tom


          Comment

          • Beauregard T. Shagnasty

            #6
            Re: PHP and FRAMES?

            Five Cats wrote:[color=blue]
            > In message <p%Rhe.35104$ia 6.20508@twister .nyroc.rr.com>, Beauregard
            > T. Shagnasty <a.nony.mous@ex ample.invalid> writes
            >[color=green]
            >> Dave Moore wrote:
            >>[color=darkred]
            >>> Hi All, I'm developing a website which incorporates a header
            >>> section at the top, side areas and a central area. If I was
            >>> developing the site with straight HTML, I'd simply use FRAMES.[/color]
            >>
            >> Google for: frames are evil
            >>
            >> Then, look at some simple HTML for a typical three-column page.
            >> http://www.benmeadowcroft.com/webdev.../3-column.html
            >>
            >> You can output the HTML with your PHP code, of course.[/color]
            >
            > He will still have the same problem even if there are no frames in
            > the output - he wants to incorporate outside files that include
            > <HEAD> and so on.[/color]

            All my sites incorporate "outside" files, including the <HEAD>. It
            works the champ, and I can change it for the whole site in one swell
            foop. <title>$pagetit le</title> is a variable passed to it, of course.

            --
            -bts
            -This space intentionally left blank.

            Comment

            • Dave Moore

              #7
              Re: PHP and FRAMES?


              "Beauregard T. Shagnasty" <a.nony.mous@ex ample.invalid> wrote in message
              news:0snie.3313 2$eU.3433@twist er.nyroc.rr.com ...[color=blue]
              > Five Cats wrote:[color=green]
              > > In message <p%Rhe.35104$ia 6.20508@twister .nyroc.rr.com>, Beauregard
              > > T. Shagnasty <a.nony.mous@ex ample.invalid> writes
              > >[color=darkred]
              > >> Dave Moore wrote:
              > >>
              > >>> Hi All, I'm developing a website which incorporates a header
              > >>> section at the top, side areas and a central area. If I was
              > >>> developing the site with straight HTML, I'd simply use FRAMES.
              > >>
              > >> Google for: frames are evil
              > >>
              > >> Then, look at some simple HTML for a typical three-column page.
              > >> http://www.benmeadowcroft.com/webdev.../3-column.html
              > >>
              > >> You can output the HTML with your PHP code, of course.[/color]
              > >
              > > He will still have the same problem even if there are no frames in
              > > the output - he wants to incorporate outside files that include
              > > <HEAD> and so on.[/color]
              >
              > All my sites incorporate "outside" files, including the <HEAD>.[/color]

              I'm sure that this can't be right. If you write a file out in HTML using
              PHP, then it will already have the normal HTML tags, like <HTML>, <HEAD> and
              <BODY>, etc. How can I introduce a FULL 3rd party HTML file into this page
              without first stripping this information out first?. Clearly simply
              'include()'ing it will result in a page with 2 lots of these tags which is
              clearly not compliant.

              Regards


              Comment

              • Dave Moore

                #8
                Re: PHP and FRAMES?


                "Tom Scales" <tomtoo@softhom e.net> wrote in message
                news:qVkie.2830 3$w15.7890@torn ado.tampabay.rr .com...[color=blue]
                >
                > "Five Cats" <cats_spam@[127.0.0.1]> wrote in message
                > news:n8$EYPAdzZ iCFwUa@[127.0.0.1]...[color=green]
                > > In message <p%Rhe.35104$ia 6.20508@twister .nyroc.rr.com>, Beauregard T.
                > > Shagnasty <a.nony.mous@ex ample.invalid> writes[color=darkred]
                > >>Dave Moore wrote:
                > >>> Hi All, I'm developing a website which incorporates a header
                > >>> section at the top, side areas and a central area. If I was
                > >>> developing the site with straight HTML, I'd simply use FRAMES.
                > >>
                > >>Google for: frames are evil
                > >>
                > >>Then, look at some simple HTML for a typical three-column page.
                > >>http://www.benmeadowcroft.com/webdev.../3-column.html
                > >>
                > >>You can output the HTML with your PHP code, of course.[/color]
                > >
                > > He will still have the same problem even if there are no frames in the
                > > output - he wants to incorporate outside files that include <HEAD> and[/color][/color]
                so[color=blue][color=green]
                > > on.[color=darkred]
                > >>[/color]
                > >
                > > --
                > > Five Cats
                > > Email to: cats_spam at uk2 dot net[/color]
                >
                > Why not just imbed an IFRAME? I use them in my PHP generated code and
                > include other HTML files. Works fine.[/color]

                I did think about IFRAMES, but I was a bit worried about support in non-IE
                browsers. Do Firefox and Netscale handle IFRAMES OK?.


                Comment

                • Els

                  #9
                  Re: PHP and FRAMES?

                  Dave Moore wrote:
                  [color=blue]
                  > "Beauregard T. Shagnasty" <a.nony.mous@ex ample.invalid> wrote in message
                  > news:0snie.3313 2$eU.3433@twist er.nyroc.rr.com ...[color=green]
                  >> Five Cats wrote:[color=darkred]
                  >>> In message <p%Rhe.35104$ia 6.20508@twister .nyroc.rr.com>, Beauregard
                  >>> T. Shagnasty <a.nony.mous@ex ample.invalid> writes
                  >>>
                  >>>> Dave Moore wrote:
                  >>>>
                  >>>>> Hi All, I'm developing a website which incorporates a header
                  >>>>> section at the top, side areas and a central area. If I was
                  >>>>> developing the site with straight HTML, I'd simply use FRAMES.
                  >>>>
                  >>>> Google for: frames are evil
                  >>>>
                  >>>> Then, look at some simple HTML for a typical three-column page.
                  >>>> http://www.benmeadowcroft.com/webdev.../3-column.html
                  >>>>
                  >>>> You can output the HTML with your PHP code, of course.
                  >>>
                  >>> He will still have the same problem even if there are no frames in
                  >>> the output - he wants to incorporate outside files that include
                  >>> <HEAD> and so on.[/color]
                  >>
                  >> All my sites incorporate "outside" files, including the <HEAD>.[/color]
                  >
                  > I'm sure that this can't be right. If you write a file out in HTML using
                  > PHP, then it will already have the normal HTML tags, like <HTML>, <HEAD> and
                  > <BODY>, etc. How can I introduce a FULL 3rd party HTML file into this page
                  > without first stripping this information out first?. Clearly simply
                  > 'include()'ing it will result in a page with 2 lots of these tags which is
                  > clearly not compliant.[/color]

                  file.php:
                  <?php include "bla.txt" ?>

                  bla.txt:
                  <html>
                  <head>
                  <title..... etc etc.



                  --
                  Els http://locusmeus.com/
                  Sonhos vem. Sonhos vão. O resto é imperfeito.
                  - Renato Russo -

                  Comment

                  • Beauregard T. Shagnasty

                    #10
                    Re: PHP and FRAMES?

                    Els wrote:[color=blue]
                    > Dave Moore wrote:
                    >
                    >[color=green]
                    >> "Beauregard T. Shagnasty" <a.nony.mous@ex ample.invalid> wrote[color=darkred]
                    >>>>> You can output the HTML with your PHP code, of course.
                    >>>>
                    >>> All my sites incorporate "outside" files, including the <HEAD>.[/color]
                    >>
                    >> I'm sure that this can't be right. If you write a file out in
                    >> HTML using PHP, then it will already have the normal HTML tags,
                    >> like <HTML>, <HEAD> and <BODY>, etc. How can I introduce a FULL
                    >> 3rd party HTML file into this page without first stripping this
                    >> information out first?. Clearly simply 'include()'ing it will
                    >> result in a page with 2 lots of these tags which is clearly not
                    >> compliant.[/color]
                    >
                    > file.php: <?php include "bla.txt" ?>[/color]

                    Just prior to the include, I use:
                    $txttitle = "Specific Title For This Page";
                    [color=blue]
                    > bla.txt:
                    > <html>
                    > <head>
                    > <title..... etc etc.[/color]

                    ...where <title> is: <title><?php echo $txttitle ?></title>

                    It goes on to include all standard <meta> elements, links to
                    stylesheets, favicon, and so forth.

                    --
                    -bts
                    -This space intentionally left blank.

                    Comment

                    Working...