Php Include Stopped Working

admin

Administrator
Staff member
After at least a couple years with no changes to the script my PHP include stopped working, no errors just does't pull my menu file into my pages anymore. My site is <!-- w --><a class="postlink" href="http://www.stmichaelroc.org">www.stmichaelroc.org</a><!-- w -->, except for the index.htm and the site map page all other pages have the include for navigation.<br /><br />here is is my include script<br /><br /><?php include('menu.php'); ?><br /><br /><br />This is a copy of the script in menu.php<br /><br /><script language="JavaScript"> <br /><!-- <br />function go(){<br />if (document.selecter.select1.options[document.selecter.select1.selectedIndex].value != "none") {<br />location = document.selecter.select1.options[document.selecter.select1.selectedIndex].value<br /> } <br />}<br />//--><br /></script><br /><br /><script language="JavaScript"> <br /><!-- <br />document.write('<form name="selecter"><select name="select1" size=1>');<br />document.write('<option value=none>Select your destination...');<br />document.write('<option value=none>--------------------');<br />document.write('<option value="index.htm">Home');<br />document.write('<option value="st_michael__menu.htm">Site Menu');<br />document.write('<option value="news.htm"> Cathedral News');<br />document.write('<option value="directions.htm">Directions and schedules');<br />document.write('<option value="events.htm">St. Michael Events');<br />document.write('<option value="what_is_orthodoxy.htm">What is Orthodox');<br />document.write('<option value="church_contacts.htm">Contact Information');<br />document.write('<option value="clergy.htm">Our Clergy');<br />document.write('<option value="hierarchs.htm">Our Hierarchs');<br />document.write('<option value="cultural.htm">Cultural Center');<br />document.write('<option value="links.htm">Web Links Page');<br />document.write('<option value="educational_pages.htm">Orthodox reference, and stories');<br />document.write('<option value="youth group.htm">Youth Pages');<br />document.write('</select>');<br />document.write('<INPUT TYPE="button" VALUE="Go" onclick="go()">');<br />document.write('</form>');<br />//--><br /></script><br /><br /><br />I can paste the raw javascript from the file into my pages and it works, I just can't figure out why the include will not. <br /><br />Also very important , even though I am pretty good at page design I am a novice at scripting especially PHP.<br /><br />Thank you<!--content-->
Your pages are .htm files and not .php files. Did this ever work for you?<br /><br />You need add the following to your .htaccess file for PHP includes to work in .htm and .html documents.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->AddType application/x-httpd-php .htm .html<!--c2--></div><!--ec2--><br /><br />I see that you are using FrontPage. Every time you install or re-install the FrontPage extensions it modifies your .htaccess file and you will have to add this line back in to use PHP includes in those documents.<!--content-->
Thank you very much that was it. I dxcon't know how that got erased from my htpaccess file. Either way that did the trick.<br /><br />Thank you again.<!--content-->
Glad I could help<!--content-->
I like to keep a copy of my .htaccess file on my computer as a backup and to edit.<!--content-->
 
Top