How to call up a file in a html page?

liunx

Guest
I'm not sure if this is the right forum but i don't know if this is server side or client side scipting needed.<br />
<br />
What i want is a menu file (e.g. menu.htm)to be called up from any page (e.g. default.htm)where i want it. When the default.htm page is loading it will have a snipet of code in it that tells the browser "Download <!--more--> menu.htm and insert it's code here, then continue on with default.htm".<br />
<br />
In this way instead of changing 200 pages on a site, i only have to change one, menu.htm, if i want to change the menu presented on the page. i hope you're with me here, i don't know how better to explain it. <br />
I know that it can be done as i've seen it on sites such as:<br />
<br />
<!-- m --><a class="postlink" href="http://www.somethingawful.com">http://www.somethingawful.com</a><!-- m --> and<br />
<!-- m --><a class="postlink" href="http://www.herzeleid.com">http://www.herzeleid.com</a><!-- m --><br />
<br />
this, however, did not help me much because when i looked at the code i saw the menu already implemented into the source. This is the reason i think it may be server sided.<br />
<br />
I used to run an asp page and for those familiar with asp you may know that inserting this:<br />
<br />
<!--#include file="file.asp"--><br />
<br />
into a page such as default.asp will be read by the server and the server will insert the contents from file.asp where that bit of code is held.<br />
<br />
Maybe i went a little to long and you've lost me but i don't even know if this has to be server side (doubt it, but not sure) or client side, what it's called and definetly no idea of how to explain it.<br />
<br />
Any help will be greatly appreciated, ofcourse.<br />
<br />
-DooGseY<!--content-->oh no way I understand fully. what you need to do it use that inlucde ( which is SSI serverside includes) and make the default.htm to a defaut.shtml file . that way the server knows how to parse it. but it sounds like you got it already.<!--content-->Could you give give me the code i need to link to the file? I don't understand you now :p<!--content--><!--#include file="file.asp"--><!--content-->Yes, but i'm not running an asp server anymore. I'm rnuning xitami and i don't know if it is compatable with shtml, certainly not asp.<br />
<br />
Is there another way to do it and what code should i use?<br />
<br />
-DooGseY<!--content-->just change the extension of the file you are uploading.<br />
<br />
<!--#include file="file.html"--><!--content-->Originally posted by scoutt <br />
just change the extension of the file you are uploading.<br />
<br />
<!--#include file="file.html"--> <br />
<br />
*sigh*<br />
<br />
No, this does not work on Xitami as it doesn't check the files for server side including before uploading/sending the file.<br />
<br />
Is there another way to do it on the client side or just the way you explained 3 times now.<br />
<br />
-DooGseY<!--content-->well that is the only way. and according to Xitami you can run SSI by default it checks it.<br />
<br />
<!-- m --><a class="postlink" href="http://www.imatix.com/html/xitami/index6.htm#TOC64">http://www.imatix.com/html/xitami/index6.htm#TOC64</a><!-- m --><!--content-->thankyou very much for your help, i got it working, the problem i have now is i have multiple directories, when i do the include i need "file.htm" to be in every dir. My question is: Is there a way i can make it point to a root so i only need one file.htm ?<br />
<br />
i tried linking with a url but that doesn't work, and doing "../file.htm" crashed my web server. is there a way i can make it point to my root dir which holds the file?<br />
<br />
thanks<!--content-->well you tried all the ones I was going to say. you can try the whole path, /path/to/www/root/file.htm<br />
<br />
if that doesn't work I would get rid of that server and go with apache.<!--content-->I've been searching for the solution to this problem for AGES now, and finally found it! <br />
<br />
I'm the biggest n00b to this sort of thing though, and don't ahve any idea how to get this working. None at all. <br />
<br />
I would like it if someone could link me to a website of some sort with information and tutorials about this.<br />
<br />
Thankyou.<!--content-->Originally posted by DooGseY <br />
thankyou very much for your help, i got it working, the problem i have now is i have multiple directories, when i do the include i need "file.htm" to be in every dir. My question is: Is there a way i can make it point to a root so i only need one file.htm ?<br />
<br />
i tried linking with a url but that doesn't work, and doing "../file.htm" crashed my web server. is there a way i can make it point to my root dir which holds the file?<br />
<br />
thanks <br />
I'd recommend using php includes:<br />
<? include ('http://yoururl.com/includeddirectory/file.ext');<br />
?><br />
that way you can include a file from anywhere using it's url instead of a path.but don't foreget to make your file with the extension .php <br />
:badbob::rocker:<!--content-->not wanting to sound like some dumb web-design philistine or anything, but why not use frames?<br />
<br />
put the menu.html into the left frame and the main content into the right frame.<!--content-->Originally posted by scoutt <br />
well you tried all the ones I was going to say. you can try the whole path, /path/to/www/root/file.htm<br />
<br />
if that doesn't work I would get rid of that server and go with apache. <br />
<br />
To link to it would i type in exactly: /path/to/www/root/file.htm or do i change the words so they are relative to me somehow...?<br />
<br />
If you just link like you said: (/path/to/www/root/file.htm)<br />
No, Xitami doesn't work with this :/ If i do change to apache, are you positive the "/path/to/www/root/file.htm" will work?<!--content-->DooGseY: all servers will work with the absolute path. yes you would have to change it so it is relative to yours. you have to have a folder that is your main webfolder, that is root. even if it is on your c drive. mine is <br />
<br />
/program files/Apache/Apache group/htdocs/www/file.htm<br />
<br />
so see the path, www is the root folder adn everything is under that. mine doesn't work online, it is just a test machine.<!--content-->
 
Back
Top