Results 1 to 2 of 2

Thread: extentions?

  1. #1

    Thread Starter
    Hyperactive Member Emo's Avatar
    Join Date
    Jul 2000
    Posts
    428

    Unhappy

    I have a quesion... Why do thay need all those different extentions like:

    • .htm
    • .html
    • .jhtml
    • .php
    • .xml
    • .cgi
    • .And the rest of 'em


    Thanks
    -Emo
    -=VB6 Enterprise Edition=-
    -=VC++6Enterprise Edition=-
    «¤E³m°O²™¤»

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Well it's to tell both the client and the server what kind of file it is, so that they know what to do with it. If it's plain text (.txt) then the server knows to just hand the file over as it is, and the client knows to display it as plain text with no formatting, just like in Notepad.

    If the file extension is .htm or .html (some platforms only support 3 characters for file extensions so this is sometimes reduced to .htm) then the server knows that, again, it should just hand over the file as it is, but now the client knows that it contains HTML tags for formatting, and it should be displayed as an HTML document and not as plain text.

    If the file is .php then the server knows that instead of just handing the file over it should pass it through a PHP interpreter first (PHP is a server side scripting language), and the PHP interpreter will produce an HTML formatted document to be sent to the client. The client knows that it should be displayed as an HTML document.

    CGI stands for Common Gateway Interface, and .cgi files are basically executable files that run on web servers and run according to parameters specified by a user. For example, when you buy something over the internet, often the website will use a CGI program to handle the order data. It is an alternative to server-side scripting.

    Basically then, the extensions are to identify the content of the file, so that both the client and the server know what to do with them.
    Harry.

    "From one thing, know ten thousand things."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width