Cuelogic Blog Icon
Cuelogic Career Icon
Home > Blog > Product Development > Web > How to execute PHP code in a HTML file?

How to execute PHP code in a HTML file?

If you want to run PHP code in .html extention file
Then Follow following procedures.

1. Write Following code in the .htaccess file

———————————————


RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

—————————————————–

2. Upload it to your server (to your WWW root) where your .html files are located

3. and write

 <?php echo "hello"; ?>

in .html file