472,789 Members | 1,321 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

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

Jul 17 '05 #1
9 1872
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.

--
-bts
-This space intentionally left blank.
Jul 17 '05 #2
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

Jul 17 '05 #3
In message <p%*******************@twister.nyroc.rr.com>, Beauregard T.
Shagnasty <a.*********@example.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.


--
Five Cats
Email to: cats_spam at uk2 dot net
Jul 17 '05 #4

"Five Cats" <ca*******@[127.0.0.1]> wrote in message
news:n8**************@[127.0.0.1]...
In message <p%*******************@twister.nyroc.rr.com>, Beauregard T.
Shagnasty <a.*********@example.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.


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


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

Tom
Jul 17 '05 #5
Five Cats wrote:
In message <p%*******************@twister.nyroc.rr.com>, Beauregard
T. Shagnasty <a.*********@example.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.


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.
Jul 17 '05 #6

"Beauregard T. Shagnasty" <a.*********@example.invalid> wrote in message
news:0s*****************@twister.nyroc.rr.com...
Five Cats wrote:
In message <p%*******************@twister.nyroc.rr.com>, Beauregard
T. Shagnasty <a.*********@example.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.


All my sites incorporate "outside" files, including the <HEAD>.


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
Jul 17 '05 #7

"Tom Scales" <to****@softhome.net> wrote in message
news:qV******************@tornado.tampabay.rr.com. ..

"Five Cats" <ca*******@[127.0.0.1]> wrote in message
news:n8**************@[127.0.0.1]...
In message <p%*******************@twister.nyroc.rr.com>, Beauregard T.
Shagnasty <a.*********@example.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.


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


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


I did think about IFRAMES, but I was a bit worried about support in non-IE
browsers. Do Firefox and Netscale handle IFRAMES OK?.
Jul 17 '05 #8
Els
Dave Moore wrote:
"Beauregard T. Shagnasty" <a.*********@example.invalid> wrote in message
news:0s*****************@twister.nyroc.rr.com...
Five Cats wrote:
In message <p%*******************@twister.nyroc.rr.com>, Beauregard
T. Shagnasty <a.*********@example.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.


All my sites incorporate "outside" files, including the <HEAD>.


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.


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 -
Jul 17 '05 #9
Els wrote:
Dave Moore wrote:

"Beauregard T. Shagnasty" <a.*********@example.invalid> wrote
> You can output the HTML with your PHP code, of course.

All my sites incorporate "outside" files, including the <HEAD>.
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.


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


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


...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.
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: les | last post by:
Hello, I just wonder what are the implications to use frames to build portal. I've seen some sites that are quite fast with frames but I just wonder if there are hidden "costs". I've tried to...
40
by: JohnnyCJohnny | last post by:
Is it pretty safe to say that almost all web surfers now use browsers that are Frames compatible? What are most people using these days? IE? Thanks
7
by: David Hayes | last post by:
I tried finding an answer on http://www.quirksmode.org/ without success. I am attempting a complicated Frames structure. I have made it work in IE, but not Netscape. I begin with three...
95
by: Neal | last post by:
Of course, every frame site I've ever seen has reduced usability and all. We've been through this before. But as frameset is still a part of HTML, there must be some legitimate use for it, hmm?...
25
by: Steal | last post by:
Hi at all I try to validate this page using the link: http://validator.w3.org/ but it return that this is not a valid HTML 4.01 page please where is it error? Steil <!DOCTYPE HTML PUBLIC...
5
by: Dfenestr8 | last post by:
Hi. I'm designing a site, and I'm trying find a way of browsing it without using frames, so I can test the <noframes> </noframes> tags. I use a linux mandrake 10 system, with KDE 3.2. Is there...
7
by: dj Bass | last post by:
simple, they don't like things that restrict the server-side controls... and when it comes to frames, you need client side stuff and that stuff's up the asp.net strategy. right or wrong?
3
by: Nish | last post by:
Is HTML frame is an old technology? Will the modern web application are developed using the HTML frames? Does all the browsers support them? Thank you for your suggestion, Nish
56
by: Deepan HTML | last post by:
Hi All, Currently i am working in a framed environment where i have divided the window as 20% and 80% and the 20% is used for navigation purpose and right frame for displaying the orignal content....
14
by: Mark | last post by:
Hi Guys, I am very new to ASP.NET world. I need to create three frames. One at the top, one on the left and another on the right side. I don't know how to do it. So please help me with it. ...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.