CGI (Common Gateway Interface)
The Common Gateway Interface or CGI, is a set of standards that define how information is
exchanged between the web server and a custom script. It is a standard for external gateway
programs to interface with information servers such as HTTP servers.
The current version is CGI//1..1 and CGI//1..2 is under progress.
To understand the concept of CGI, let see what happens when we click a hyper link to browse a
particular web page or UR. The browser contacts the HTTP web server and demand for the URL
i.e. filename.
Web Server will parse the URL and will look for the filename in if it finds that file then sends
back to the browser otherwise sends an error message indicating that you have requested a wrong
file. Web browsers takes response from web server and displays either the received file or error
message. However,, it is possible to set up the HTTP server so that whenever a file in a certain
directory is requested that file is not sent back; instead it is executed as a program, and whatever
that program outputs is sent back for your browser to display. This function is called the
Common Gateway Interface or CGI and the programs are called CGI scripts. These CGI
programs can be a PERL
Script, Shell Script, C or C++ program etc.
CGI Architecture Diagram
The CGI Architecture Diagram
ASP (Active Server Pages)
Active Server Pages (ASP) is Microsoft's first server-side scripting language and
engine for dynamic web pages.It was first released in December 1996, before being superseded
in January 2002 by ASP.NET.
Architecture
ASP uses scripting on the server to generate content that is sent to the client's web browser via
HTTP response. The ASP interpreter reads and executes all script code between <% and %>
tags, the result of which is content generation. These scripts were written
using VBScript, JScript, or PerlScript. The @Language directive, the <script language="manu"
runat="server" /> syntax or server configuration can be used to select the language. In the
example below, Response.Write Now() is in an HTML page; it would be dynamically replaced
by the current time of the server.
Server side Client Side
The server's current time: The server's current time:
<% Response.Write Now()%> 8/11/2015 6:24:45 PM
Web pages with the .asp filename extension use ASP, although some web sites disguise their
choice of scripting language for security purposes by using the more
common .htm or .html extensions. Pages with the .aspx extension use compiled ASP.NET;
however, ASP.NET pages may still include some ASP scripting. The introduction of ASP.NET
led to use of the term Classic ASP for the original technology.
Sun Java System ASP (formerly ChiliSoft ASP) was a popular and reportedly complete
emulator,[4] but it has been discontinued.