Professional Web Applications Themes

PHP and FRAMES? - PHP Development

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> ...

  1. #1

    Default 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



    Dave Guest

  2. #2

    Default Re: PHP and FRAMES?

    Dave Moore wrote: 

    Google for: frames are evil

    Then, look at some simple HTML for a typical three-column page.
    http://www.benmeadowcroft.com/webdev/csstemplates/3-column.html

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

    --
    -bts
    -This space intentionally left blank.
    Beauregard Guest

  3. #3

    Default 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

    chotiwallah Guest

  4. #4

    Default Re: PHP and FRAMES?

    In message <p%Rhe.35104$nyroc.rr.com>, Beauregard T.
    Shagnasty <invalid> writes 
    >
    >Google for: frames are evil
    >
    >Then, look at some simple HTML for a typical three-column page.
    >http://www.benmeadowcroft.com/webdev/csstemplates/3-column.html
    >
    >You can output the HTML with your PHP code, of course.[/ref]

    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. 

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

  5. #5

    Default Re: PHP and FRAMES?


    "Five Cats" <cats_spam[127.0.0.1]> wrote in message
    news:n8$EYPAdzZiCFwUa[127.0.0.1]... 
    >>
    >>Google for: frames are evil
    >>
    >>Then, look at some simple HTML for a typical three-column page.
    >>http://www.benmeadowcroft.com/webdev/csstemplates/3-column.html
    >>
    >>You can output the HTML with your PHP code, of course.[/ref]
    >
    > 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. 
    >
    > --
    > Five Cats
    > Email to: cats_spam at uk2 dot net[/ref]

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

    Tom


    Tom Guest

  6. #6

    Default Re: PHP and FRAMES?

    Five Cats wrote: 
    >>
    >> Google for: frames are evil
    >>
    >> Then, look at some simple HTML for a typical three-column page.
    >> http://www.benmeadowcroft.com/webdev/csstemplates/3-column.html
    >>
    >> You can output the HTML with your PHP code, of course.[/ref]
    >
    > 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.[/ref]

    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>$pagetitle</title> is a variable passed to it, of course.

    --
    -bts
    -This space intentionally left blank.
    Beauregard Guest

  7. #7

    Default Re: PHP and FRAMES?


    "Beauregard T. Shagnasty" <invalid> wrote in message
    news:0snie.33132$nyroc.rr.com... 
    > >
    > > 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.[/ref]
    >
    > All my sites incorporate "outside" files, including the <HEAD>.[/ref]

    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


    Dave Guest

  8. #8

    Default Re: PHP and FRAMES?


    "Tom Scales" <net> wrote in message
    news:qVkie.28303$tampabay.rr.com... 
    > >
    > > 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[/ref][/ref]
    so 
    > >
    > > --
    > > Five Cats
    > > Email to: cats_spam at uk2 dot net[/ref]
    >
    > Why not just imbed an IFRAME? I use them in my PHP generated code and
    > include other HTML files. Works fine.[/ref]

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


    Dave Guest

  9. #9

    Default Re: PHP and FRAMES?

    Dave Moore wrote:
     
    >>
    >> All my sites incorporate "outside" files, including the <HEAD>.[/ref]
    >
    > 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.[/ref]

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

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



    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vo. O resto imperfeito.
    - Renato Russo -
    Els Guest

  10. #10

    Default Re: PHP and FRAMES?

    Els wrote: 
    >>
    >> 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.[/ref]
    >
    > file.php: <?php include "bla.txt" ?>[/ref]

    Just prior to the include, I use:
    $txttitle = "Specific Title For This Page";
     

    ...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.
    Beauregard Guest

Similar Threads

  1. Frames... but not frames
    By meeesta in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: May 27th, 03:42 PM
  2. Frames in ASP.Net
    By Nedu N in forum ASP.NET Building Controls
    Replies: 4
    Last Post: December 8th, 06:20 AM
  3. [PHP] PHP within Frames
    By Larry in forum PHP Development
    Replies: 7
    Last Post: October 20th, 09:06 PM
  4. new frames
    By David Hendren in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 2
    Last Post: July 21st, 06:56 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139