Include PHP files in HTML pages using .HTACCESS

Posted by admin | HTML, php, utils | Tuesday 8 September 2009 12:40 am

Usually, its not possible to include PHP files into HTML pages. Here i got a way for this which works. Its nothing but using .HTACCESS.

Create a .HTACCESS file in the root folder or a specified folder.
Add the below code  into your .HTACCESS file

Options +FollowSymLinks
AddType application/x-httpd-php .htm

Thats it

Now, you can include PHP files into your Static HTML Pages.

 

5 Comments »

  1. Comment by druva — September 8, 2009 @ 1:22 am

    does it works with CAKE PHP? and i would like to see simple example. can u do that please

  2. Comment by raju ss — September 8, 2009 @ 3:09 am

    Yes.. It works with CakePHP too..

  3. Pingback by Why You Should CSS Instead of Tables When Designing Your Web Page | Web Design and all stuff related to it! — September 8, 2009 @ 2:50 pm

    [...] Include PHP files in HTML pages « Totus Info [...]

  4. Pingback by Compare HTML Files | Web Design and all stuff related to it! — September 21, 2009 @ 5:38 am

    [...] Include PHP files in HTML pages « Totus Info [...]

  5. Pingback by Using Perl and Regular Expressions to Process Html Files – Part 1 | Web Design and all stuff related to it! — October 2, 2009 @ 9:30 pm

    [...] Include PHP files in HTML pages « Totus Info [...]

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.