Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace HTML frames

Status
Not open for further replies.

tyrannus

MIS
Apr 6, 2006
115
US
Hi all,

I have developed my own websites utilizing frames, but have been torn apart for using them. I instead want to use PHP and tables to do the same thing. Does anyone have a tutorial for this that can help get me started?



Thanks,
Tyrannus
 
this is not really a php question but a css question.

i'd bet you'll get equally torn apart for redesigning using tables in this day and age.

have a look at for inspiration: the guy who wrote the site is a genius (and no - not me: i'm a lot younger and have more hair).
 
I know that PHP can be used to emulate frames only its tons better. I am just having trouble finding a tutorial or anyother help on the matter.
 
honestly - i don't know what you mean by "emulating frames" with php. when you say you know, what is the source of the knowledge. if you can point me in the right direction i'm sure i can work out what they mean and in turn be able to set you on the right track.

fyi: so far as i know there is nothing that php (a 100% server side application) can do to assist the emulation of frames on a browser (100% client). having said that, there are some clever things we can do now involing a combination of javascript and php (or most other server side languages). this is a technology known as AJAX. the key element in this is javascript: not the server side interpreter.
 
In other words insted of using frames, you use PHP to echo out a table that has the same layout and style of frames. Only not using frames...
 
i'm lost.

sure you can use php to print a table. in the same way that you can use php to print the frameset and each element of the frameset. php can handle any kind of html.

but ... imho ... don't use tables for anything other than tabular data. for everything else try and separate content from style. use css.

to use php to echo a table, create the table in html. save it to a file

Code:
<?
echo file_get_contents("tabledesign.txt");
?>

but there's no point in doing this. why parse normal html through a php interpreter?

now if you're after dynamic content: that's a different story and php is the right monkey for the wrench. But that's nothing to do with migrating from frames to tables or any other frameless structure.
 
Basically what I want is this... If you look at a page with frames and you have a frame across the top, a frame with links on the left and the rest of the space is used to display what ever pages are clicked on the links.. I want to do that only using PHP and tables..
 
is the content dynamic or static?

i say again : the migration from frames to tables has nothing whatsoever with php. others in this forum might take a different view - let's see.

a basic html structure using tables looks like this (and this is so inadvisable):

Code:
<table width="100%" border=1>
<tr height="10%"><td colspan="3">Header text goes here</td></tr>
<tr height="480px" valign="top"><td width="10%" >left hand menu goes here</td><td width="80%">center text goes here</td><td width="10%">right text goes here</td></tr>
<tr height="10%"><td colspan="3">footer text goes here</td></tr>
</table>
 
I think what tyrannus means is: To alter a content area using PHP. While keeping the rest static.

In which case you´d be beter of using DIV's you could then have the links point all to the same page, say index.php, and depending on the paramters passed it would show different content in the "content" div. While other divs remain the same.

It might emulate frames in a sense, but you'll need to reload the page every time a link is clicked so PHP can use the parameter passed to determine what content to display.

This is advantageous when you want to have a central template for your webiste, and have only the content part change. That way you really only have to alter one page. and the alterations site wide.

Example:

A sample menu:
Code:
<a href="index.php?content=welcome">Home Page</a>
<a href="index.php?content=photos">Photo Gallery</a>
<a href="index.php?content=form">Contact Form</a>
All links point to index.php, but depending on the paramter passed in the link, what is shown in the center area would change.
Code:
<div id="content">
<?php

if(isset($_GET['content'])){
if($_GET['content']="welcome"){

[green]//read from the content file that has the welcome part, and display inside the div. [/green]
}
}

?>
</div>

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Yes!! Vacunita hit it right on.. That is what I want to do is have a basic template and have the content change in one cell while everything else remains looking the same.. I know the page would have to reload everytime All I need is a starter and I can figure out the rest..
 
I know it is not fashionable but I prefer tables for layout.
I program mainly in PERL which has the same functionality as PHP and I create the HTML code in sections. These can be created in whatever HTML, text editor you prefer.
Throughout the script, any of the parts can be called and creating pages can be controlled from a small amount of code. I incorporate CSS for colour and style but only use positioning in the header section.

Keith
 
Glad I could help. If you need any fuerther help, dont hesitate to post back.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top