Click to See Complete Forum and Search --> : Page Header Question
tam42025
04-24-2003, 12:14 PM
I have over 500 pages and I don't want to put them in frames to acheive what I want to do. If I decide to change the look of my page later on, I was wondering if there was a way to create a header for my site with javascript that will place that header on every page in my site. I want to elliminate the need to update every page when I customize my site.
Try changing .html to .php or .cgi or .pl or .asp and then ask this question in the ASP for CGI forum...
tam42025
04-24-2003, 12:20 PM
There is no way of doing this with javascript.
I seriously doubt it. It's gonna have to be server-side... Because you're gonna have to read from an external file... Am I right or am I not? :)
havik
04-24-2003, 12:25 PM
You could change your page to .shtml and do includes of pages that way (isn't that what they call server side inclues? I'm not sure).
example:
<doctype....whatever>
<html>
<head>
<title>test</title>
</head>
<body>
<!--#include file="header.shtml"-->
// your content here
<!--#include file="bottom.shtml"-->
</body>
</html>
The header and bottom will contain the code and any alteration to them will alter all pages.
Havik
tam42025
04-24-2003, 12:25 PM
Okay Thanks!
I guess my best bet then is to use frames because as little as I know about javascript, I know even less about asp,php. lol
tam42025
04-24-2003, 12:29 PM
with that code would I have to go in and place the altered information on each page. I guess what I am looking for is a way I can write a file with my header information in it. And use another code to call what's inside that header(not the url address) to all the pages that I place the code in.
havik
04-24-2003, 12:35 PM
with the code I posted, you will have to go into each page and insert it (obviously). But after that, any changes to the file that's being included will result in changes to all pages because they all include that file.
Here's a link on it:
http://www.mattkruse.com/info/ssi/
But you should contain your system admin because SSI's may not be enabled.
Havik
tam42025
04-24-2003, 12:42 PM
thank you so very much. I am going to try and do that now.
Originally posted by havik
....(isn't that what they call server side inclues? I'm not sure)...
Yup.
havik
04-24-2003, 01:08 PM
ok, now I know for sure. (never bothered to look it up).
Havik
Originally posted by tam42025
There is no way of doing this with javascript. It might be a little late, but.... Yes, you can. However, server side scripting is a much better way to do it, as using javascript will cause it not to show up for 10% of people...