1

I have a question. I am fairly new to all of this. I had to switch my website main index from .php to.html. In doing so all of my menu items are not coming up anymore. I believe it has to do with the statement below. My question is how do I change this statement to an html statement that looks up this file so that my meno items come up again.

<?php require("http://www.boonecountysports.com/includes/menu_drop_head.php"); ?>
ɹɐqʞɐ zoɹǝɟ
  • 4,342
  • 3
  • 22
  • 35
  • Plain HTML can't provide an include like that. What web server do you use (Apache, IIS, for example)? Most web servers have the ability to rewrite incoming requests such that if a user requests index.html, index.php is executed and served. (or do you no longer have PHP available at all?) – Michael Berkowski May 31 '14 at 02:59
  • You need to modify the .htaccess file as described in this answer: http://stackoverflow.com/questions/4687208/using-htaccess-to-make-all-html-pages-to-run-as-php-files – Allan Spreys May 31 '14 at 03:00
  • You could use htaccess: Check [here][1] how. [1]: http://stackoverflow.com/questions/4687208/using-htaccess-to-make-all-html-pages-to-run-as-php-files – Radu Vlad May 31 '14 at 03:00

3 Answers3

1

Changing to an html extension will render php code useless. Your server will only process php code or specifically <?php require("http://www.boonecountysports.com/includes/menu_drop_head.php"); ?> if the file has an extension of php. To make this work, use the php extension

SoWhat
  • 5,564
  • 2
  • 28
  • 59
0

You need to modify the .htaccess file as described in this answer: Using .htaccess to make all .html pages to run as .php files?

Create a .htaccess file at the root of your website and add this line:

[Apache2 @ Ubuntu/Debian: use this directive]

AddType application/x-httpd-php .html .htm If your are running PHP as CGI (probably not the case), you should write instead:

AddHandler application/x-httpd-php .html .htm

Community
  • 1
  • 1
Allan Spreys
  • 5,287
  • 5
  • 39
  • 44
0

It depends on the contents of included php file; if the file has html and javascript ONLY you can use that code in the place where the php file included

Ayman Al-Shorman
  • 190
  • 1
  • 2
  • 18