mattschinkel
10-13-2002, 03:09 AM
I am currently using frames for my site www.nowdammit.com, It works ok, but I'd rather not use frames. What do you think about frames? Anyways, I would like to see some of your code for using headers & footers if possible. Is there a certain way of doing it that loads the fastest? My top frame does not require php, I am only using flash for the header.
Thanks,
Matt
cortices
10-13-2002, 04:07 AM
I don't know about faster, but it's typically wise to use include_once() instead of include() so as to not accidentally include it twice...
skelley1
10-13-2002, 04:52 AM
frames bad. css good http://hotwired.lycos.com/webmonkey/98/15/index0a.html?tw=authoring
akashik
10-13-2002, 10:03 AM
Just use a server side include:
<!--#include virtual="head.html" -->
for example for the head file. Rename your page to .shtml, or if you prefer to keep the .html extension, make a .htaccess file with this witten in it:
AddType text/x-server-parsed-html .html
Greg Moore
seanf
10-17-2002, 03:38 PM
Generally frames = bad. For the site I'm building I am using a class which let's me use about 4 lines to create a page and all I need to do is plug in the content. This is probably more than you are looking for though. As has been said, a simple method is to just use includes:
page.php
<?php
@ include 'header.htm';
echo 'hello';
@ include 'footer.htm';
?>
header.htm
<p align="center">
footer.htm
</p>
Of course you don't want to take my <p> example literally! :stickout:
Sean :)
jnyost
10-18-2002, 01:38 PM
I agree with the fact that frames are bad. Most search engines will tell you that you shouldn't use them.
I recommend using css as much as you can to save on page size and then I use Macromedia MX templates for my pages. By creating template, I can edit one file and have it shove the changes to all of the other files that were based upon that one.
There is also ssi include. This also works well and I have used this on a few sites. The only complaint with that is you either have configure your web server to parse things other than shtm or shtml for ssi, or name your files like that. It is also not real easy to preview on your local machine.
jared
akashik
10-18-2002, 03:39 PM
Originally posted by jnyost
The only complaint with that is you either have configure your web server to parse things other than shtm or shtml for ssi, or name your files like that. It is also not real easy to preview on your local machine.
The .htaccess file I mentioned above does a great job for parsing serverside includes. The performance hit is minimal so unless you're pushing hundreds of thousands of pages a day I wouldn't worry too much.
The preview issue can be a bother though, if you're not using Dreamweaver (which uses a 'render engine' to show parsed pages in preview). You just need to use some lateral thinking :D
Greg Moore
MarlboroMan
10-19-2002, 07:42 AM
I find it's better to actually write your header and footer as a PHP function, so you can pass information to it that can change its appearance.