SlideShare a Scribd company logo
Note of 
CGI & ASP 
William.L 
wiliwe@gmail.com 
2013-12-05
Index 
Static & Dynamic Web Pages............................................................................................................................... 3 
In early times – CGI ............................................................................................................................................. 4 
A Successor of CGI - ASP..................................................................................................................................... 6 
Resource................................................................................................................................................................. 8
Static & Dynamic Web Pages 
"Static" means unchanged or constant, while "dynamic" means changing or lively. Therefore, static Web 
pages contain the same prebuilt content each time the page is loaded, while the content of dynamic Web pages 
can be generated on-the-fly(at runtime). 
Standard HTML pages are static Web pages. They contain HTML code, which defines the structure and 
content of the Web page. Each time an HTML page is loaded, it looks the same. The only way the content of an 
HTML page will change is if the Web developer updates and publishes the file. 
Dynamic Web pages, such as PHP, ASP, and JSP pages, contain "server-side" code, which allows the server to 
generate unique content each time the page is loaded. It may also output a unique response based on a Web form 
the user filled out. Many dynamic pages use server-side code to access database information, which enables the 
page's content to be generated from information stored in the database. Web sites that generate Web pages from 
database information are often called database-driven websites. 
There are two primary ways to create a dynamic Web page: 
* Generate the HTML tags via conventional C code. CGI, Common Gateway Interface, is this way. 
* Create the Web page and insert dynamic data at run time via expansion tags(or called escape tag) 
The first way requires no special handling by the Web server and may seem an attractive approach at first. But, 
cause to that Web pages are hard to engineer if you cannot see the final result, so programmers need 
development cycle “edit, compile, display, re-edit, re-compile, re-display”, this is very tedious. 
The second approach allows much faster development cycles. Many HTML design tools such as DreamWeaver, 
can be used to create Web pages in a WYSIWYG manner. All that remains, is the dynamic data that is replaced 
at run time. In this way, the Web page whose full content is generated dynamically contains mini-tags that are 
expanded into real tags with the dynamic data. 
In general, dynamic Web pages have special file extension other than conventional ".htm" or ".html," for the 
recognition of what dynamic Web page technology is adopted such as ".asp", ".php", ".jsp", etc. If it is ".htm" 
or ".html," the page is probably static.
In early times – CGI 
Quoted from W3C (http://www.w3.org/CGI/): 
“An HTTP server is often used as a gateway to a legacy information system; for example, an existing body 
of documents or an existing database application. The Common Gateway Interface is an agreement 
between HTTP server implementors about how to integrate such gateway scripts and programs.” 
CGI is NOT a language but a simple protocol that can be used to communicate between Web forms and your 
(CGI)program. The CGI program is known as CGI script or simply CGI; a CGI program could be written in a 
scripting language or any programming language. CGI programs(executable scripts(with “.cgi” extension) 
or binary files) are usually put in a folder named “cgi-bin”(known CGI directory) under Web server 
document root directory(containing all Web pages(ex: index.html) and relevant resources(ex: pictures)). 
When a request to a CGI program is received by the Web server, it runs the program as a separate process, 
rather than within the Web server process. For each CGI request the environment of the new process must be set 
to include all the CGI variables(environmemt variables) defined in CGI RFC specification. 
The latest version of CGI is v1.1 and was specified as RFC 3875. 
[PDF] http://www.potaroo.net/ietf/rfc/rfc3875.pdf 
[Text] http://www.potaroo.net/ietf/rfc/rfc3875.txt 
The below figure shows the basic flow of generation of dynamic Web pages through GCI. 
Web 
Client 
(browser) 
(2) Invoke 
( STDIN + EnvVar ) 
Web Server 
CGI 
program 
A separate 
process 
Generate (3) 
HTML 
page 
(1) 
HTTP Request 
HTTP Response 
(5) 
(4) Return 
(STDOUT) 
A CGI program mainly contains three parts: standard input(STDIN), standard output(STDOUT) and 
environment variable. The CGI program receives Web messages from Web server through STDIN and send 
generated Web messages to Web server through STDOUT. Web clients(browsers) communicate information 
with Web server through environment variable. 
Reading the User's Form Input 
When the user submits the form, your script receives the form data as a set of name-value pairs. The names are 
what you defined in the INPUT tags (ex: select or textarea), and the values are whatever the user typed in or
selected. 
This set of name-value pairs is given to you as one long string, which you need to parse. The long string is in 
one of these two formats: 
"name1=value1&name2=value2&name3=value3" 
"name1=value1;name2=value2;name3=value3" 
The execution of a CGI program is to create a process and starting the process can consume much more time 
and memory than the actual work of generating the output. So, if the program is called often, the resulting 
workload can quickly overwhelm the Web server. Cause to this short point of CGI, the new way to generate 
Web pages dynamically was developed, e.g. to insert expansion tags into Web pages and convert to actual data 
at runtime(when being request).
A Successor of CGI - ASP 
Active Server Pages (ASP) is a Microsoft developed approach to allow the easy creation of dynamic Web 
pages. Originally shipped in Microsoft IIS, it has now been ported to a wide variety of platforms and is 
available from many vendors in commercial products. 
Active Server Pages permits the scripting of dynamic data using JavaScript or any other supported scripting 
language (ex:VBscript). The Web server would then evaluate the ASP script and the results are substituted into 
the page replacing the original script before it is sent to the user's browser. This should be done in a one-pass 
operation for maximum efficiency. By using such server-side scripting, the dynamic data to be displayed is 
easily modified without recompiling the Web server. 
Web pages using ASP normally(but not mandatorily) have an “.asp” extension to distinguish them form normal 
HTML pages. To insert ASP tag in a Web page, the scripting code is encapsulated/enclosed using the special 
marking “<%” and “%>”, also called ASP delimiter. 
<%TagName1%> 
<html> 
<head> 
</head> 
<body> 
<%TagName2%> 
</body> 
</html> 
Actual Data 1 
<html> 
<head> 
</head> 
<body> 
Actual Data 2 
</body> 
</html> 
Web server scans and 
replaces escape tags 
with actual data 
The below figure shows the basic flow of generation of dynamic Web pages through ASP. 
Web 
Client 
(browser) 
Web Server 
HTML Page 
<%TagName1%> 
<%TagName2%> 
Replace (2) 
HTML Page 
Actual Data 1 
Actual Data 2 
(1) 
HTTP Request 
HTTP Response 
(3)
For small Web server(GoAhead, Boa) using ASP way to generate dynamic Web pages, a programmer add ASP 
tags in Web page and tag handlers in Web server code correspondingly. In practice, it usually uses table-style to 
store “EscapeTag - TagHandler” pair, EscapeTag is string type and TagHandler is function pointer. For 
example (in C language, TagHandlerEntry is a structure), 
TagHandlerEntry AspTagHandlerTab[] = { 
{ "get_timezone", get_timezone }, 
{ "get_date", get_date}, 
... 
}; 
Some Web server may provide pre-defined macro for programmer to add each entry of tag handler table. 
GoAhead is one such Web server, it provides function websAspDefine() to register an ASP tag and its handler 
into the tag handler table.
Resource 
* GoAhead WebServer White Paper 
http://www.embed.com.cn/protocol/goahead/GoAhead%20WebServer%20white%20paper.doc
Ad

More Related Content

What's hot (20)

IBM zOS Basics
IBM zOS BasicsIBM zOS Basics
IBM zOS Basics
Anderson de Souza
 
Aula 02 - JavaScript: Arrays
Aula 02 - JavaScript: ArraysAula 02 - JavaScript: Arrays
Aula 02 - JavaScript: Arrays
Jessyka Lage
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
BG Java EE Course
 
Architecture of exadata database machine – Part II
Architecture of exadata database machine – Part IIArchitecture of exadata database machine – Part II
Architecture of exadata database machine – Part II
Paresh Nayak,OCP®,Prince2®
 
Aula 04 PHP - Utilizando Funções e Manipulando Arquivos
Aula 04 PHP - Utilizando Funções e Manipulando ArquivosAula 04 PHP - Utilizando Funções e Manipulando Arquivos
Aula 04 PHP - Utilizando Funções e Manipulando Arquivos
Daniel Brandão
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
rehaniltifat
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
chriskite
 
Planos arquitectonicos el modelo de 4+1 vistas de la
Planos arquitectonicos el modelo de 4+1 vistas de laPlanos arquitectonicos el modelo de 4+1 vistas de la
Planos arquitectonicos el modelo de 4+1 vistas de la
Julio Pari
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
Manisha Keim
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
Tony Tam
 
Banco de Dados - Conceitos Básicos
Banco de Dados - Conceitos BásicosBanco de Dados - Conceitos Básicos
Banco de Dados - Conceitos Básicos
Adriano Leite da Silva
 
Servidor proxy
Servidor proxy Servidor proxy
Servidor proxy
Silvino Neto
 
Creating Web Applications with IDMS, COBOL and ADSO
Creating Web Applications with IDMS, COBOL and ADSOCreating Web Applications with IDMS, COBOL and ADSO
Creating Web Applications with IDMS, COBOL and ADSO
Margaret Sliming
 
API de segurança do Java EE 8
API de segurança do Java EE 8API de segurança do Java EE 8
API de segurança do Java EE 8
Helder da Rocha
 
Desenvolvimento de Sistemas Web - Conceitos Básicos
Desenvolvimento de Sistemas Web - Conceitos BásicosDesenvolvimento de Sistemas Web - Conceitos Básicos
Desenvolvimento de Sistemas Web - Conceitos Básicos
Fabio Moura Pereira
 
Spring Boot
Spring BootSpring Boot
Spring Boot
koppenolski
 
Ibm db2
Ibm db2Ibm db2
Ibm db2
aditi212
 
Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...
Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...
Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...
Impetus Technologies
 
Sqlite - Introdução
Sqlite - IntroduçãoSqlite - Introdução
Sqlite - Introdução
Joao Johanes
 
Aula 02 - JavaScript: Arrays
Aula 02 - JavaScript: ArraysAula 02 - JavaScript: Arrays
Aula 02 - JavaScript: Arrays
Jessyka Lage
 
Architecture of exadata database machine – Part II
Architecture of exadata database machine – Part IIArchitecture of exadata database machine – Part II
Architecture of exadata database machine – Part II
Paresh Nayak,OCP®,Prince2®
 
Aula 04 PHP - Utilizando Funções e Manipulando Arquivos
Aula 04 PHP - Utilizando Funções e Manipulando ArquivosAula 04 PHP - Utilizando Funções e Manipulando Arquivos
Aula 04 PHP - Utilizando Funções e Manipulando Arquivos
Daniel Brandão
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
rehaniltifat
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
chriskite
 
Planos arquitectonicos el modelo de 4+1 vistas de la
Planos arquitectonicos el modelo de 4+1 vistas de laPlanos arquitectonicos el modelo de 4+1 vistas de la
Planos arquitectonicos el modelo de 4+1 vistas de la
Julio Pari
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
Manisha Keim
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
Tony Tam
 
Creating Web Applications with IDMS, COBOL and ADSO
Creating Web Applications with IDMS, COBOL and ADSOCreating Web Applications with IDMS, COBOL and ADSO
Creating Web Applications with IDMS, COBOL and ADSO
Margaret Sliming
 
API de segurança do Java EE 8
API de segurança do Java EE 8API de segurança do Java EE 8
API de segurança do Java EE 8
Helder da Rocha
 
Desenvolvimento de Sistemas Web - Conceitos Básicos
Desenvolvimento de Sistemas Web - Conceitos BásicosDesenvolvimento de Sistemas Web - Conceitos Básicos
Desenvolvimento de Sistemas Web - Conceitos Básicos
Fabio Moura Pereira
 
Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...
Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...
Planning your Next-Gen Change Data Capture (CDC) Architecture in 2019 - Strea...
Impetus Technologies
 
Sqlite - Introdução
Sqlite - IntroduçãoSqlite - Introdução
Sqlite - Introdução
Joao Johanes
 

Viewers also liked (8)

Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
William Lee
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)
William Lee
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
William Lee
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
William Lee
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
William Lee
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
William Lee
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)
William Lee
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
William Lee
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
William Lee
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)
William Lee
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
William Lee
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
William Lee
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
William Lee
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
William Lee
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)
William Lee
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
William Lee
 
Ad

Similar to Note of CGI and ASP (20)

Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
Anup Hariharan Nair
 
Decoding the Web
Decoding the WebDecoding the Web
Decoding the Web
newcircle
 
Presemtation Tier Optimizations
Presemtation Tier OptimizationsPresemtation Tier Optimizations
Presemtation Tier Optimizations
Anup Hariharan Nair
 
Html5
Html5Html5
Html5
mikusuraj
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
Gopi A
 
Web 2 0 Tools
Web 2 0 ToolsWeb 2 0 Tools
Web 2 0 Tools
ramesh kumar
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving
mdc11
 
Web-Technologies 26.06.2003
Web-Technologies 26.06.2003Web-Technologies 26.06.2003
Web-Technologies 26.06.2003
Wolfgang Wiese
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
Timo Herttua
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Integrate Sas With Google Maps
Integrate Sas With Google MapsIntegrate Sas With Google Maps
Integrate Sas With Google Maps
vineetkaul
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
Santosh Pandey
 
Fm 2
Fm 2Fm 2
Fm 2
sambavade
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web Application
Sachin Walvekar
 
CGI by rj
CGI by rjCGI by rj
CGI by rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB
 
Simpler Web Architectures Now! (At The Frontend 2016)
Simpler Web Architectures Now! (At The Frontend 2016)Simpler Web Architectures Now! (At The Frontend 2016)
Simpler Web Architectures Now! (At The Frontend 2016)
Gustaf Nilsson Kotte
 
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB
 
Decoding the Web
Decoding the WebDecoding the Web
Decoding the Web
newcircle
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
Gopi A
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving
mdc11
 
Web-Technologies 26.06.2003
Web-Technologies 26.06.2003Web-Technologies 26.06.2003
Web-Technologies 26.06.2003
Wolfgang Wiese
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
Timo Herttua
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Integrate Sas With Google Maps
Integrate Sas With Google MapsIntegrate Sas With Google Maps
Integrate Sas With Google Maps
vineetkaul
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web Application
Sachin Walvekar
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB
 
Simpler Web Architectures Now! (At The Frontend 2016)
Simpler Web Architectures Now! (At The Frontend 2016)Simpler Web Architectures Now! (At The Frontend 2016)
Simpler Web Architectures Now! (At The Frontend 2016)
Gustaf Nilsson Kotte
 
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB
 
Ad

More from William Lee (20)

Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
William Lee
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
William Lee
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
William Lee
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
William Lee
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding Window
William Lee
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
William Lee
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
William Lee
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
William Lee
 
MGCP Overview
MGCP OverviewMGCP Overview
MGCP Overview
William Lee
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
William Lee
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
William Lee
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
William Lee
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OS
William Lee
 
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeGNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in Gnome
William Lee
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069
William Lee
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)
William Lee
 
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)
William Lee
 
Qt Development Tools
Qt Development ToolsQt Development Tools
Qt Development Tools
William Lee
 
Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069
William Lee
 
Qt Animation
Qt AnimationQt Animation
Qt Animation
William Lee
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
William Lee
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
William Lee
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
William Lee
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
William Lee
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding Window
William Lee
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
William Lee
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
William Lee
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
William Lee
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
William Lee
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
William Lee
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
William Lee
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OS
William Lee
 
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeGNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in Gnome
William Lee
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069
William Lee
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)
William Lee
 
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)
William Lee
 
Qt Development Tools
Qt Development ToolsQt Development Tools
Qt Development Tools
William Lee
 
Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069
William Lee
 

Recently uploaded (20)

#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 

Note of CGI and ASP

  • 1. Note of CGI & ASP William.L [email protected] 2013-12-05
  • 2. Index Static & Dynamic Web Pages............................................................................................................................... 3 In early times – CGI ............................................................................................................................................. 4 A Successor of CGI - ASP..................................................................................................................................... 6 Resource................................................................................................................................................................. 8
  • 3. Static & Dynamic Web Pages "Static" means unchanged or constant, while "dynamic" means changing or lively. Therefore, static Web pages contain the same prebuilt content each time the page is loaded, while the content of dynamic Web pages can be generated on-the-fly(at runtime). Standard HTML pages are static Web pages. They contain HTML code, which defines the structure and content of the Web page. Each time an HTML page is loaded, it looks the same. The only way the content of an HTML page will change is if the Web developer updates and publishes the file. Dynamic Web pages, such as PHP, ASP, and JSP pages, contain "server-side" code, which allows the server to generate unique content each time the page is loaded. It may also output a unique response based on a Web form the user filled out. Many dynamic pages use server-side code to access database information, which enables the page's content to be generated from information stored in the database. Web sites that generate Web pages from database information are often called database-driven websites. There are two primary ways to create a dynamic Web page: * Generate the HTML tags via conventional C code. CGI, Common Gateway Interface, is this way. * Create the Web page and insert dynamic data at run time via expansion tags(or called escape tag) The first way requires no special handling by the Web server and may seem an attractive approach at first. But, cause to that Web pages are hard to engineer if you cannot see the final result, so programmers need development cycle “edit, compile, display, re-edit, re-compile, re-display”, this is very tedious. The second approach allows much faster development cycles. Many HTML design tools such as DreamWeaver, can be used to create Web pages in a WYSIWYG manner. All that remains, is the dynamic data that is replaced at run time. In this way, the Web page whose full content is generated dynamically contains mini-tags that are expanded into real tags with the dynamic data. In general, dynamic Web pages have special file extension other than conventional ".htm" or ".html," for the recognition of what dynamic Web page technology is adopted such as ".asp", ".php", ".jsp", etc. If it is ".htm" or ".html," the page is probably static.
  • 4. In early times – CGI Quoted from W3C (http://www.w3.org/CGI/): “An HTTP server is often used as a gateway to a legacy information system; for example, an existing body of documents or an existing database application. The Common Gateway Interface is an agreement between HTTP server implementors about how to integrate such gateway scripts and programs.” CGI is NOT a language but a simple protocol that can be used to communicate between Web forms and your (CGI)program. The CGI program is known as CGI script or simply CGI; a CGI program could be written in a scripting language or any programming language. CGI programs(executable scripts(with “.cgi” extension) or binary files) are usually put in a folder named “cgi-bin”(known CGI directory) under Web server document root directory(containing all Web pages(ex: index.html) and relevant resources(ex: pictures)). When a request to a CGI program is received by the Web server, it runs the program as a separate process, rather than within the Web server process. For each CGI request the environment of the new process must be set to include all the CGI variables(environmemt variables) defined in CGI RFC specification. The latest version of CGI is v1.1 and was specified as RFC 3875. [PDF] http://www.potaroo.net/ietf/rfc/rfc3875.pdf [Text] http://www.potaroo.net/ietf/rfc/rfc3875.txt The below figure shows the basic flow of generation of dynamic Web pages through GCI. Web Client (browser) (2) Invoke ( STDIN + EnvVar ) Web Server CGI program A separate process Generate (3) HTML page (1) HTTP Request HTTP Response (5) (4) Return (STDOUT) A CGI program mainly contains three parts: standard input(STDIN), standard output(STDOUT) and environment variable. The CGI program receives Web messages from Web server through STDIN and send generated Web messages to Web server through STDOUT. Web clients(browsers) communicate information with Web server through environment variable. Reading the User's Form Input When the user submits the form, your script receives the form data as a set of name-value pairs. The names are what you defined in the INPUT tags (ex: select or textarea), and the values are whatever the user typed in or
  • 5. selected. This set of name-value pairs is given to you as one long string, which you need to parse. The long string is in one of these two formats: "name1=value1&name2=value2&name3=value3" "name1=value1;name2=value2;name3=value3" The execution of a CGI program is to create a process and starting the process can consume much more time and memory than the actual work of generating the output. So, if the program is called often, the resulting workload can quickly overwhelm the Web server. Cause to this short point of CGI, the new way to generate Web pages dynamically was developed, e.g. to insert expansion tags into Web pages and convert to actual data at runtime(when being request).
  • 6. A Successor of CGI - ASP Active Server Pages (ASP) is a Microsoft developed approach to allow the easy creation of dynamic Web pages. Originally shipped in Microsoft IIS, it has now been ported to a wide variety of platforms and is available from many vendors in commercial products. Active Server Pages permits the scripting of dynamic data using JavaScript or any other supported scripting language (ex:VBscript). The Web server would then evaluate the ASP script and the results are substituted into the page replacing the original script before it is sent to the user's browser. This should be done in a one-pass operation for maximum efficiency. By using such server-side scripting, the dynamic data to be displayed is easily modified without recompiling the Web server. Web pages using ASP normally(but not mandatorily) have an “.asp” extension to distinguish them form normal HTML pages. To insert ASP tag in a Web page, the scripting code is encapsulated/enclosed using the special marking “<%” and “%>”, also called ASP delimiter. <%TagName1%> <html> <head> </head> <body> <%TagName2%> </body> </html> Actual Data 1 <html> <head> </head> <body> Actual Data 2 </body> </html> Web server scans and replaces escape tags with actual data The below figure shows the basic flow of generation of dynamic Web pages through ASP. Web Client (browser) Web Server HTML Page <%TagName1%> <%TagName2%> Replace (2) HTML Page Actual Data 1 Actual Data 2 (1) HTTP Request HTTP Response (3)
  • 7. For small Web server(GoAhead, Boa) using ASP way to generate dynamic Web pages, a programmer add ASP tags in Web page and tag handlers in Web server code correspondingly. In practice, it usually uses table-style to store “EscapeTag - TagHandler” pair, EscapeTag is string type and TagHandler is function pointer. For example (in C language, TagHandlerEntry is a structure), TagHandlerEntry AspTagHandlerTab[] = { { "get_timezone", get_timezone }, { "get_date", get_date}, ... }; Some Web server may provide pre-defined macro for programmer to add each entry of tag handler table. GoAhead is one such Web server, it provides function websAspDefine() to register an ASP tag and its handler into the tag handler table.
  • 8. Resource * GoAhead WebServer White Paper http://www.embed.com.cn/protocol/goahead/GoAhead%20WebServer%20white%20paper.doc