Execution of HTML as PHP

1. To be able to handle php script in .html file , you need to add the following in the .htaccess file:

AddType application/x-httpd-php5.html

2. To check that the setup works you need to create the following .html file and add the following php code in it:


<html>
<head> </ head>
<body>
<? php echo "Hello world!";?>
</ body>
</ html>

3. Save the file named test.html and upload it to your web hosting account.

When writing the address http://domain.com/test.html in the browser you should see the message Hello World!

 

 

  • 13685 Users Found This Useful
這篇文章有幫助嗎?

相關文章

How to Create a Full cPanel Backup

1. From the home page of your HayHost client area, navigate to the "Your Active...

How to Install WordPress Manually Using cPanel

1. From the home page of your HayHost client area, navigate to the "Your Active...

How to Create a Database in cPanel (MySQL Database)

1. From the home page of your HayHost client area, then click  "SERVICES".   2. In the "My...

How to Create a Subdomain in cPanel

This article will go over creating a Subdomain under your cPanel account. Log into cPanel on...