Click to See Complete Forum and Search --> : At a loss...
Ceveres
01-01-2004, 04:35 PM
Hi everyone. I've searched the web as best as I could, but I simply cannot find what I need - this forum might be the last place I have.
I'm working on a website that will have a single, consistent template/page design throughout. I have the template already made and is working properly.
The thing is, I will have a row of links located at the top. And I know for a fact that in the future I will need to change it... Currently only the colors of the template have a css file, but the tables and html do not.
The question: how can I create a file that holds HTML that I can tell a page to use? A file with a list of links... would there be a way to tell a page to refere to that file? What format do I use, ect...
Any help is appreciated.
fredmv
01-01-2004, 04:41 PM
Welcome to the forums.
All you'll need is some very simple server-side scripting to include an external file. If, for example, you had a file called navigation.txt and wanted to include it on every page, you could do use with PHP like this:<?php
include('navigation.txt');
?>Or, if you have SSI available (which most server do), you could use:<!--#include file="navigation.txt -->Another option, if server-side scripting isn't available, would be to use the <object> (http://www.w3.org/TR/REC-html40/struct/objects.html#edef-OBJECT) tag to embed an external file. However, if server-side scripting is available to you, I would recommend it over using the <object> (http://www.w3.org/TR/REC-html40/struct/objects.html#edef-OBJECT) tag.
Ceveres
01-01-2004, 04:49 PM
Hmmm. Ok. Neither of those want to work x.x
I tried both those codes, but to no avail. I put them in just as you have them (after changing the name if the file to which it links), is there something I've forgotten to do?
Should I show you the script??
fredmv
01-01-2004, 04:52 PM
Are you trying this locally? If so, that's why they aren't working correctly. It must be on a Web server. for the first one to work, you need PHP installed, for the second, you need SSI. For the third, you shouldn't need a Web server or a scripting lanugage.
Ceveres
01-01-2004, 04:55 PM
It's all on a server... And it says is supports all these sorta things - php, ssi, css, whatever.
fredmv
01-01-2004, 05:02 PM
I see. Well, two questions: Do you have permission to run PHP scripts? Was the file you were trying to include in the same directory?
Paul Jr
01-01-2004, 06:22 PM
One thing, on the page where you put the PHP include, did you rename the extension to .php?
fredmv
01-01-2004, 07:12 PM
Originally posted by Paul Jr
One thing, on the page where you put the PHP include, did you rename the extension to .php? Good question. I should've specified that. For the second example you will need to have a .shtml (or equivalent) extension for it to work correctly.
CodeGod
01-02-2004, 05:34 AM
Ceveres!
what's there in the include file (navigation.txt) ? :p
And please mention the exact error phrase in your next post.
Good luck!
eviljoker7075
01-02-2004, 06:50 AM
Can't you just link into the HTML document in the same way that you would with a CSS file? Maybe that's a stupid question, but you can do it with CSS files and JavaScript files and so can't you do it with HTML files?
aoeguy
01-02-2004, 08:30 AM
No, you can only use frames in HTML.
But you still cant get content there. CSS is made to use like that and JS is a script
Ceveres
01-02-2004, 09:30 AM
Wait, jeeze, I'm wicked confused now! The file with the html in it, what should it's extension be? txt, shtml!?
And yes, the server supports php, and everything is in the same directory. Code God, I'm not getting an error messege - the html isn't showing up on the page where I'm putting it.
Ceveres
01-02-2004, 09:33 AM
WHOA!?
It works now.... x.x
I ended up using the second line you gave me... just a lot of trial and error x.x
Thank you all very much!