Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TRICK] Write php codes inside .html files
#1
As you know that php and html are quite different from each other. You may enter html codes inside the .php file BUT you can't do such within .html files , i.e., you are unable to write php codes inside .html files.

Here I am sharing you a simple trick to write php codes inside any .html files of your website Smile

Create a blank file and call it .htaccess, you will need to upload this file on your server in the directory where you want to have .html pages containing php code or you can also place the .htaccess file in your site root, the settings inside it will apply to all its sub directories.

Now write the following code inside your .htaccess file and save it:

Code:
AddType application/x-httpd-php .html .htm .php

And you are done ! Now write any php codes inside .html files and the server side language (I mean php) will function correctly. Smile

Enjoy this tip


This tip is shared by zone for www.supportforums.net . If you want to share this, you are free to do so, but please give credit to me.


Thankyou very much and be happy Smile
Reply


Messages In This Thread
[TRICK] Write php codes inside .html files - by zone - 11-24-2009, 11:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 943 07-27-2020, 11:26 PM
Last Post: tk-hassan
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,671 10-10-2011, 01:00 PM
Last Post: Greyersting
  How to write good php code [Must Read] BannedPoop 19 6,518 08-30-2011, 08:28 AM
Last Post: Slash
  HTML&PHP Games. flAmingw0rm 25 4,455 06-04-2011, 07:23 AM
Last Post: Strafeness
  HTML Website Anon 6 2,370 06-01-2011, 03:26 AM
Last Post: !LoL

Forum Jump:


Users browsing this thread: 10 Guest(s)