Different File Extensions for Web Pages (What are .asp, .php pages?)

Different File Extensions for Web Pages (What are .asp, .php pages?)

Surf around the web for a while and you will notice that some of the web pages that you view have different file extensions. For example, this web page is titled web-page-extensions.htm. It could have been titled web-page-extensions.html though. So what is different between all of these extensions? Is a .asp better or worse than a .cgi extension? Or is everyone just being creative?

When your internet browser requests a web page from a web host it examines the file extension. If the extension is hyper text mark up language (.htm or .html) then it is rendered in your browser. If the extension is something else then, depending on what the extension is, the server software does something to the page and then sends you the page. What the server software does depends on what is written in the web page. And frequently the web pages are running programming scripts or mini-computer programs which are processing data before or after you arrive.

For example, if you have ever been to a web page which displays the IP address of where you are (an IP address is a numerical address of your computer on the internet), chances are the web page is a .php extension. Why? Because using the PHP language it is very easy to display this. What happens when you request the page with the .php extension is that the server software runs a computer script (a PHP language script in this case) and before the web page is displayed in your browser, it adds the results of the computer script. So the .php extension allows a web page to interact dynamically with each person visiting the site. Thus, each time someone visits your php page, they will see something different because the IP address of their computer is different from yours.

Some of the different extensions you will see are as follows:


.php (Hypertext Preprocessor Lanugage: Scripting language in the web page itself)


.asp (Active Server Pages: Another scripting language, found mainly on Microsoft Servers)


.aspx(.net technology: Microsoft's latest scripting ability and more, will be found on Microsoft Servers running the .net technology)


.cgi (Common Gateway Interface: Calls a computer program for caluculations or processing, computer program can be a wide variety of languages)


.pl (Perl Extension: Calls a Perl Script for processing)


So every time you see a web page with a different extension other than .htm or .html you know more is going on.

What is CGI? Perl?

CGI (Common Gateway Interface) is a very common word when web hosting is mentioned. Frequently, but incorrectly, people usually asked web hosting providers if they can run CGI scripts on their accounts. What they are actually asking, albeit indirectly, is if they can use CGI to run computer programs on their website.

CGI, in simple terms, is essentially an intermediary between the a computer script and the web site. It operates to take the information from the web page and pass it to a computer script (program) and do whatever the computer program says to do. CGI is not a computer language per se, but a common language for different computer programs to interact with the web pages (hence Common Gateway Interface).

One of the recognized, and highly used, computer program languages which uses CGI is Perl. Perl is a high level computer language which can manipulate files, text and perform system operations with ease. Perl scripts are highly used on the web and quite frequently you hear about a very common perl script known as "formmail." A formmail script is essentially a computer program written in Perl which takes information from a web page and e-mails the information to someone. This is accomplished when someone fills out a form on a web page and presses a button. The button then starts the computer program (formmail) which uses CGI to get the information from the webpage and e-mails the information. Perl scripts have been written to do quite a lot of things on a web site and it is a very powerful language. But, it is not the only computer language which can interact with a web page. Some others are ASP, PHP, C, Python, etc.


  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

DNS Propugation or Why does it take up to three days for my site to be visible?

  DNS Propugation or Why does it take up to three days for my site to be visible? Once...

Difference Between IMAP & POP3

What is the difference between an IMAP and a POP mail account? Without going into all of the...

Root Access, Do I need it?

Root Access, Do I need it?A lot of times people want hosting with access to root. But what does...

SPAM: Blacklists & Whitelists

SPAM: Blacklists & Whitelists  Spam. Anyone connected to the Internet has heard the...

SSH (Secure Shell Access)

SSH (Secure Shell Access) What is SSH and why would you want it? SSH stands for Secure Shell...