boblan66 Posted November 6, 2010 Share Posted November 6, 2010 I wish to create the top menu as an include file, to save work later down the road when the menu needs to change, I created a folder and named it includes and saved the menu code as hozMenu.txt. Which was placed in that folder. I then placed the following at the location in the html page where the menu would be placed, <!--#include virtual="includes/hozMenu.txtl" --> I load the include folder and modified page with the include statement to the server. Iy does not call in the menu. What may be going in error. It's driving me nuts! <div class="art-header"> <div class="art-header-png"></div> <div class="art-header-jpeg"></div> <div class="art-logo"> <h1 id="name-text" class="art-logo-name"><a href="#">Taft Union High School</a></h1> <div id="slogan-text" class="art-logo-text">Class of 1965</div> </div> </div> <!--#include virtual="includes/hozMenu.html" --> <div class="art-content-layout"> <div class="art-content-layout-row"> <div class="art-layout-cell art-sidebar1"> The code being included: <div class="art-nav"> <div class="l"></div> <div class="r"></div> <ul class="art-menu"> <li><a href="#" class="active"><span class="l"></span><span class="r"></span><span class="t">Home</span></a></li> <li><a href="about.html"><span class="l"></span><span class="r"></span><span class="t">About us</span></a></li> <li><a href="#"><span class="l"></span><span class="r"></span><span class="t">Photo Gallery</span></a> <ul> <li><a href="reunion45/DurkinsParty/index.html">Durkin's Party</a></li> <li><a href="reunion45/Reunion1/index.html">Reunion 1</a></li> <li><a href="reunion45/Reunion2/index.html">Reunion 2</a></li> <li><a href="reunion45/Reunion3/index.html">Reunion 3</a></li> <li><a href="reunion45/JuliesHome/index.html">Julie's Home</a></li> </ul> <li><a href="#"><span class="l"></span><span class="r"></span><span class="t">Member Search</span></a></li> <li><a href="links.html"><span class="l"></span><span class="r"></span><span class="t">Links</span></a></li> </ul> </div> Thanks in advanced for any assistance. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted November 6, 2010 Share Posted November 6, 2010 Server side includes (SSI) require that your server be configured to use SSI, which typically also requires that you use a special file extension (.shtml, .stm, .shtm) on the main file. Have you confirmed that your server has been configured to use SSI and that your main file ends in the an extension that your server has been configured to use for SSI? You have also listed three different file extensions in your post for the included file - .txt, .txtl, .html You need to put the actual name into the <---#include ---> statement. Quote Link to comment Share on other sites More sharing options...
boblan66 Posted November 7, 2010 Author Share Posted November 7, 2010 The server has been configured for ssi. I think you hit the problem, I remembered that the file extension must be ,shtml. Thanks for jogging my memory. Let me try it and see what happens. Quote Link to comment Share on other sites More sharing options...
boblan66 Posted November 7, 2010 Author Share Posted November 7, 2010 I changed the extension of the mail file to hozMenu.shtm and changed the include call to reflect the chang. Does not work! :-\ Quote Link to comment Share on other sites More sharing options...
haku Posted November 8, 2010 Share Posted November 8, 2010 did you fix the fact that you were using different file extensions in different locations? As PMfbadsid said, you have .txt. .txtl and .html. Pick one and stick with it everywhere. Make sure the actual file is named that as well. And also make sure the parent file is .shtml - that's the file that the include statements are placed in. Quote Link to comment Share on other sites More sharing options...
boblan66 Posted November 8, 2010 Author Share Posted November 8, 2010 Yes, I fixed the different file extensions and placed .shtml on the page sending the include. Nothing worked. I did use php calls for some .php files I writing, they worked fine. Thanks for the reply. Still frustrated. One other question. Does a page that has a bit of HTML and PHP witin it, need to have a .php file extension? Quote Link to comment Share on other sites More sharing options...
trq Posted November 8, 2010 Share Posted November 8, 2010 One other question. Does a page that has a bit of HTML and PHP witin it, need to have a .php file extension? Unless you configure your server especially to handle other file types as php, yes. Quote Link to comment Share on other sites More sharing options...
haku Posted November 8, 2010 Share Posted November 8, 2010 Two questions: 1) Why are you using server side includes if you have php installed? PHP includes will do the same thing. 2) If you really need for some reason (that I can't think of) to use SSI instead of PHP includes, can you show us your current code and file names? Quote Link to comment Share on other sites More sharing options...
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.