Jump to content

Simple Ssi Problem


GPSJane

Recommended Posts

I have only just begun with php so I am not looking to do anything complicated but I do need to use SSI to make updating easier.BUT, when I put the include in the page doesn't display correctly at all even though I designed the page first meticulously before transferring part of it to a text file.Here is the include code I am using and then the html.

<?php include("includes/nav_bar.txt"); ?>

			<DIV id="logo">				<IMG class="nav" src="images/flower.png"><!--<IMG class="nav" src="images/title.png"> -->			</DIV>			<DIV id="nav_bar_top">			</DIV>						<DIV id="nav_bar_middle">				<UL class="nav_list">					<LI class="nav_item"><A class="nav" href=""><DIV id="middle">Home</DIV></A></LI>					<LI class="nav_item"><A class="nav" href=""><DIV id="middle">Invitation</DIV></A></LI>					<LI class="nav_item"><A class="nav" href=""><DIV id="middle">Information</DIV></A></LI>					<LI class="nav_item"><A class="nav" href=""><DIV id="middle">Map & Directions</DIV></A></LI>					<LI class="nav_item"><A class="nav" href=""><DIV id="middle">Accomodation</DIV></A></LI>					<LI class="nav_item"><A class="nav" href=""><DIV id="middle">Registry</DIV></A></LI>					<LI class="nav_item"><A class="nav" href=""><DIV id="middle">Invitation</DIV></A></LI>				</UL>			</DIV>						<DIV id="nav_bar_bottom">			</DIV>

It looks like the DIV and IMG tags are all missing but I can't understand why?

Link to comment
Share on other sites

Er, I seem to figure things out as I write them down here! Even after spending ages on them before.Does the file type of the part to be included matter? It seems to as I changed the include to .html and now all is good :)DO I always use html or do I ever use txt or something else?

Link to comment
Share on other sites

Make sure your server is running PHP and that the file you have the include statements in is a .php file. By default the server won't execute PHP code inside a .html file, only .php. Your include files don't need to be .php files, but the file that has the include statement does need to be.

Link to comment
Share on other sites

Oh ja I wasn't clear. My file with the include statement is a php file and php is running just fine. But the stuff to be included was a txt file which didn't work but now as an html it's fine.Eg: index.php had an include pointing to menu.txt. I had to change it to menu.html for it to work.

Make sure your server is running PHP and that the file you have the include statements in is a .php file. By default the server won't execute PHP code inside a .html file, only .php. Your include files don't need to be .php files, but the file that has the include statement does need to be.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...