Using PHP as frames?

botboy

2[H]4U
Joined
Mar 21, 2000
Messages
2,680
Please excuse my PHP-newbness if this sounds off the wall and stupid...

I'm currently reworking my website to use PHP includes to break down the site into a main page ("index.php") and then have a left pane for navigation (lbar.php), footer bar with contact/copyright info (lbar.php). I have some code set up so that when you surf to the main page you get rbar.php in the right pane, which is news, and all links in the left pane (except for the one to the forums) direct you to index.php?page=foo, so that rbar.php is replaced with foo.php.

Ok, so that gets you from the main page to the first level of subpages (tech articles, projects, etc). What I'm curious about is whether or not it would be possible to have some sort of include within an include, so that one could keep a heading in the right pane ("projects" for example) and then clicking a link underneath would keep the projects heading, but fill in a second level subpage (a technical article you clicked on in the projects page).

Is this possible, or is it more trouble than its worth?
 
Sounds like you need to separate front-end and back-end.

You appear to be describing a page using actual framesets. The interface you want can be accomplished with them, yes.

PHP, however, has nothing to do with framesets. It generates content but is not tied to end-user display. Can PHP generate the content seen in a frame-based page? Sure.

Do I think all these nested frames are a good way to build a site? Nope. They ruin your site's search engine friendliness, its accessibility, and its expected behavior. They're tough to scroll through and bookmark. Printing is always iffy.

There are better ways. Basic methods use standard layouts (CSS or tables), and you could use PHP's includes to fill content similarly to how frame pages work. More advanced setups would be akin to GMail, where only part of the page is downloaded (like frames) without exposing you to the various nastiness of frames.
 
lomn75 said:
Sounds like you need to separate front-end and back-end.

You appear to be describing a page using actual framesets. The interface you want can be accomplished with them, yes.

Nope, I'm not using any framesets at all. I hate frames - I think they look antiquated and I am aware of search engine problems. My site uses a basic tabled html page and php include functions to fill in various parts (like the navigation pane, footer, etc that are just defined as tables)

Do I think all these nested frames are a good way to build a site? Nope. They ruin your site's search engine friendliness, its accessibility, and its expected behavior. They're tough to scroll through and bookmark. Printing is always iffy.

The idea I was trying to get at (and having a somewhat hard time articulating) was to have php "simulate" nested frames using tables and include functions, but retain the URI of an individual page.
 
Not sure exactly what your asking for...You want an explorer style nav menu with [+] and [-] type trees?
As far as keeping the url the same, not sure, but the whole point of the index.php?link=page is that you pass a variable to the page and that variable lets the page know what link the user clicked on. You could try something with cookies to make it behind the scenes so the url stays index.php but good luck with that.
 
botboy said:
The idea I was trying to get at (and having a somewhat hard time articulating) was to have php "simulate" nested frames using tables and include functions, but retain the URI of an individual page.

Here's an idea. How about you figure out how to articulate your post BEFORE making the thread so that people don't have to play 20 questions to figure out what the hell you are trying to get at?
 
Back
Top