Jump to content

include not functioning


boblan66

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.