HTA Script – Parse HTML files as PHP




Tagged Under : , ,

Version: 13.1
Revision: 23 Build 13

Parse HTML files as PHP

pickaweb-server-logoIntroduction:
On the 29th of October, I was trying to get my server to parse php codes from a html / htm file. However, when I tried to define the extension, my server just prompt the user to download a file. But, that is not what I wanted! So, I asked Pickaweb for assistance. Soon enough, my problem was fixed!

Here is my tutorial for Pickaweb users. But, please be aware that this article is only for user who is registered with Pickaweb, as their hosting provider.

Notes: by parsing php codes inside your html file, you can implement image – ads and other sources without touching your main file. This is also useful if you’re adding a big chunk of codes without messing your original html / htm files.

1.] Login to your FTP server and look for your “.htaccess” file.

2.] Rename the file and download it to your hard drive.

3.] Copy one of these codes and paste it to the bottom of your “.htaccess” file.

// For PHP5 Server.
// -----------------------
AddHandler application/x-httpd-php5 .html .htm
AddType x-mapp-php5 .html .htm

// For PHP4 Server.
// ----------------------
AddHandler application/x-httpd-php4 .html .htm
AddType x-mapp-php4 .html .htm

4.] Save your changes and delete your old “.htaccess” file (online server).

5.] Upload your modified file and rename it. After that, you will need to clear your Internet caches and temporary files.

6.] Check your website and have fun!

7.] You are done!

Copyrighted By Lair360