Click to See Complete Forum and Search --> : Including PHP in an HTML page


Ascendancy
08-11-2007, 11:54 AM
I want to design a site using HTML, but I wanted to load all of the navigations through a PHP include. Is there a way that I can somehow attach a PHP file to the HTML page that will load the navigation that way?

afigueroa
08-11-2007, 01:45 PM
well, you can include the include through the html:

<body>
<?php
include('some_file.ext");
?>

Ascendancy
08-11-2007, 04:11 PM
Will that still be parsed even though the file's extension is .html and not .php?

felgall
08-11-2007, 04:22 PM
It will if you add the following lines to the .htaccess file

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

afigueroa
08-11-2007, 08:03 PM
if your server is set up properly (and somewhat unrestrictive), it will allow you to include all types of files (js, php, perl, etc)