jsull Posted March 10, 2004 Posted March 10, 2004 I'm putting together a new site and I'm trying to get it to use two (2) include directives, so I can have my main menubar be one .txt file and my content be another. I'm using the code below to try it, but it will only look the top one. ><!--#include virtual="/menubar.txt" --> <!--#include virtual="/mtblogs/articles.txt" --> Yes, there is a folder named mtblogs which articles.txt resides in. I loaded that one fine before I tried to put the menubar.txt as an include. But when I try to load both only the top one (menubar) appears on the page. Is this just as far as shtml goes? I can only include once? If so, is this something that PHP could do for me? (I've never tried anything with PHP yet) Thank you in advance for your help. Quote
borfast Posted March 10, 2004 Posted March 10, 2004 (edited) I moved this to the Scripting Talk forum for better exposure. As for your problem, I've never used server side includes but I don't think there's any restrictions on how many files you can include. Have you tried putting articles.txt above menubar.txt and see if it works? If so, then perhaps it's something on menubar.txt that is preventing articles.txt from loading. Edited March 10, 2004 by TCH-Raul Quote
jsull Posted March 10, 2004 Author Posted March 10, 2004 I've never used server side includes but I don't think there's any restrictions on how many files you can include. Have you tried putting articles.txt above menubar.txt and see if it works? If so, then perhaps it's something on menubar.txt that is preventing articles.txt from loading. I didn't think about doing that only because menubar.txt includes my HEAD section. I put that in menubar.txt because part of my menu bar is a javascript. I'll try saving menubar.txt from the BODY down. Quote
jsull Posted March 10, 2004 Author Posted March 10, 2004 It seems to be functioning ok If I only do the include on everything below body and not the head. May make things a little strange if I change the menubar, which is why I wanted to use the server side includes. Quote
MikeJ Posted March 10, 2004 Posted March 10, 2004 Note that those included files are interpreted as HTML, so make sure that it all is formatted correctly. Things like missing closing tags in menubar.txt could cause the rest of the document to fail to display, or display incorrectly. As for server side includes, there is no limit on how many you can have in a page. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.