View Full Version : Is there a script for this?
mhp9983
January 17th, 2002, 22:27
Is there a way I can use a general template, and a large empty space (like forums) where content could be added on automatically by different files/pages. Sorta like frames but I want to shy away from frames. Is there some coding thing that would allow me to do that? Javascript or CGI or something? Thanks!
meow
January 18th, 2002, 03:48
You may want to look into SSI (Server Side Includes). It can also be done with PHP.
mhp9983
January 18th, 2002, 17:41
Please elaborate on the php part if you can. thanks!
meow
January 18th, 2002, 17:49
Someone else better do it, I don't know PHP.
I bookmarked this page the other day. Seems easy enough to understand. Maybe you can have some use for it. :)
Using Require() and Include() in PHP
http://www.jwweb.com/20010629.html
Dusty
January 18th, 2002, 18:15
PHP way:
Rename the page to have a .php extension and add this where you want the header to be included:
<?php include "header.txt"; ?>
SSI way:
Rename the page to have a .shtml extension and add this where you want the header to be included:
<!--#include virtual="header.txt"-->
In both cases the HTML for the header would be in the header.txt file, you can do the same for a footer in a file called footer.txt. Both the PHP and SSI do the same thing, it doesn't matter which you use.
On each page where you want the default header and footer to be shown just use either the SSI call or PHP snippet above. That's not exactly a "template" but it would achieve what you want to do.
bigperm
January 21st, 2002, 22:34
Also, in PHP, if you name your includes in *.php then they will be parsed also, great if you want a global.asa type of variable master sheet.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.