SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical AnalyzerArchana Gopinath
 
Using Control Flow for Generating Dynamic Content
Using Control Flow for Generating Dynamic ContentUsing Control Flow for Generating Dynamic Content
Using Control Flow for Generating Dynamic ContentPradip Bhattarai
 
Transaction launcher
Transaction launcherTransaction launcher
Transaction launcherkalyan238
 
Linked Data Technology and Status
Linked Data Technology and StatusLinked Data Technology and Status
Linked Data Technology and StatusMyungjin Lee
 
Sap abap part1
Sap abap part1Sap abap part1
Sap abap part1sailesh107
 
Software Engineering Lab Manual
Software Engineering Lab ManualSoftware Engineering Lab Manual
Software Engineering Lab ManualNeelamani Samal
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processorshindept123
 
Architectural structures and views
Architectural structures and viewsArchitectural structures and views
Architectural structures and viewsDr Reeja S R
 
Dmee sap online_help
Dmee sap online_helpDmee sap online_help
Dmee sap online_helpgabrielsyst
 
Language processing activity
Language processing activityLanguage processing activity
Language processing activityDhruv Sabalpara
 
SAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshots
SAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshotsSAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshots
SAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshotsSubhrajyoti (Subhra) Bhattacharjee
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMRajendran
 
Alv object model simple 2 d table - event handling
Alv object model   simple 2 d table - event handlingAlv object model   simple 2 d table - event handling
Alv object model simple 2 d table - event handlinganil kumar
 
CNF & Leftmost Derivation - Theory of Computation
CNF & Leftmost Derivation - Theory of ComputationCNF & Leftmost Derivation - Theory of Computation
CNF & Leftmost Derivation - Theory of ComputationDrishti Bhalla
 
Installed base configuration steps.doc
Installed base configuration steps.docInstalled base configuration steps.doc
Installed base configuration steps.docRipunjay Rathaur
 
Wcm overview
Wcm overviewWcm overview
Wcm overviewamit1858
 

Was ist angesagt? (20)

Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical Analyzer
 
Using Control Flow for Generating Dynamic Content
Using Control Flow for Generating Dynamic ContentUsing Control Flow for Generating Dynamic Content
Using Control Flow for Generating Dynamic Content
 
Transaction launcher
Transaction launcherTransaction launcher
Transaction launcher
 
Compiler lec 8
Compiler lec 8Compiler lec 8
Compiler lec 8
 
Linked Data Technology and Status
Linked Data Technology and StatusLinked Data Technology and Status
Linked Data Technology and Status
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lecture
 
Work clearance management config and steps
Work clearance management   config and stepsWork clearance management   config and steps
Work clearance management config and steps
 
Sap abap part1
Sap abap part1Sap abap part1
Sap abap part1
 
Software Engineering Lab Manual
Software Engineering Lab ManualSoftware Engineering Lab Manual
Software Engineering Lab Manual
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processor
 
Architectural structures and views
Architectural structures and viewsArchitectural structures and views
Architectural structures and views
 
Dmee sap online_help
Dmee sap online_helpDmee sap online_help
Dmee sap online_help
 
Language processing activity
Language processing activityLanguage processing activity
Language processing activity
 
SAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshots
SAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshotsSAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshots
SAP PM - WCM: Enhanced Model - Entire process flow with SAP screenshots
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
 
System software
System softwareSystem software
System software
 
Alv object model simple 2 d table - event handling
Alv object model   simple 2 d table - event handlingAlv object model   simple 2 d table - event handling
Alv object model simple 2 d table - event handling
 
CNF & Leftmost Derivation - Theory of Computation
CNF & Leftmost Derivation - Theory of ComputationCNF & Leftmost Derivation - Theory of Computation
CNF & Leftmost Derivation - Theory of Computation
 
Installed base configuration steps.doc
Installed base configuration steps.docInstalled base configuration steps.doc
Installed base configuration steps.doc
 
Wcm overview
Wcm overviewWcm overview
Wcm overview
 

Andere mochten auch

Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 UsageWilliam 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 PageWilliam Lee
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCapWilliam Lee
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerWilliam 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 PHPWilliam Lee
 

Andere mochten auch (8)

Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
 
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)
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
 
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)
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 

Ähnlich wie Note of CGI and ASP

Decoding the Web
Decoding the WebDecoding the Web
Decoding the Webnewcircle
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3Gopi 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 savingmdc11
 
Web-Technologies 26.06.2003
Web-Technologies 26.06.2003Web-Technologies 26.06.2003
Web-Technologies 26.06.2003Wolfgang Wiese
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSTimo 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 HandlingWebStackAcademy
 
Integrate Sas With Google Maps
Integrate Sas With Google MapsIntegrate Sas With Google Maps
Integrate Sas With Google Mapsvineetkaul
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web ApplicationSachin 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 TutorialMongoDB
 
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 indiaJignesh 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 TutorialMongoDB
 
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 TutorialMongoDB
 

Ähnlich wie Note of CGI and ASP (20)

Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Decoding the Web
Decoding the WebDecoding the Web
Decoding the Web
 
Presemtation Tier Optimizations
Presemtation Tier OptimizationsPresemtation Tier Optimizations
Presemtation Tier Optimizations
 
Html5
Html5Html5
Html5
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
 
Web 2 0 Tools
Web 2 0 ToolsWeb 2 0 Tools
Web 2 0 Tools
 
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
 
Web-Technologies 26.06.2003
Web-Technologies 26.06.2003Web-Technologies 26.06.2003
Web-Technologies 26.06.2003
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
 
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
 
Integrate Sas With Google Maps
Integrate Sas With Google MapsIntegrate Sas With Google Maps
Integrate Sas With Google Maps
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
Fm 2
Fm 2Fm 2
Fm 2
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web Application
 
CGI by rj
CGI by rjCGI by rj
CGI by rj
 
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
 
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
 
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
 
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)
 
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch Tutorial
 

Mehr von 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 LanguagesWilliam 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 LinuxWilliam 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.3William Lee
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding WindowWilliam 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 ChooserWilliam Lee
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserWilliam Lee
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginWilliam Lee
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationWilliam 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.5William Lee
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBBWilliam Lee
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OSWilliam 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 GnomeWilliam 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-069William 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 ToolsWilliam 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-069William Lee
 

Mehr von 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
 
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
 
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
 
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
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding Window
 
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
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
 
MGCP Overview
MGCP OverviewMGCP Overview
MGCP Overview
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
 
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
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OS
 
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
 
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
 
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)
 
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)
 
Qt Development Tools
Qt Development ToolsQt Development Tools
Qt Development Tools
 
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
 
Qt Animation
Qt AnimationQt Animation
Qt Animation
 

Kürzlich hochgeladen

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 

Kürzlich hochgeladen (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

Note of CGI and ASP

  • 1. Note of CGI & ASP William.L wiliwe@gmail.com 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