Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,

Slides:



Advertisements
Similar presentations
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 1 Introduction to Perl and CGI.
Advertisements

Adding Dynamic Content to your Web Site
DT228/3 Web Development WWW and Client server model.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Web documents types 1. 2 Three basic types of web documents Static. A static web document resides in a file that it is associated with a web server. The.
PART 6 Application Layer
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
1 Chapter 12 Working With Access 2000 on the Internet.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
Introduction to Web Interface Technology (CSE2030)
Python and Web Programming
Chapter 27 HTTP and WWW.
Introduction to Web Interface Technology (CSE2030)
Advanced Web Technologies. Frames Forms Plugins Dynamic Pages---CGI Active Pages: Java, Java Script.
Hypertext Transport Protocol CS Dick Steflik.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
CE80N Introduction to Networks & The Internet Dr. Chane L. Fullmer UCSC Winter 2002.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
Common Gateway Interface
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Chapter 9 Using Perl for CGI Programming. Computation is required to support sophisticated web applications Computation can be done by the server or the.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
Web Programming Pre-01– Introduction to Dynamic Web Aryo Pinandito, ST, M.MT.
Overview A plain HTML document is static A CGI program is executed in real-time, so that it can output dynamic information. CGI (Common Gateway Interface)
CP3024 Lecture 3 Server Side Facilities. Lecture contents  Server side includes  Common gateway interface (CGI)  PHP Hypertext Preprocessor (PHP) pages.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Internet Server Group zAndrew Kozarik - CGI zBrandon Zarzoza- C# zChris Young- Perl zLawrence M. - Python zJohn Hall - JSP zRay Skoog- TCL zChad Stadig-
HTTP; The World Wide Web Protocol
Dynamic Web Sites Chris North cs3724: HCI. Presentations matt ketner, sam altman, mike gordon Vote: UI Hall of Fame/Shame?
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
CPS120: Introduction to Computer Science The World Wide Web Nell Dale John Lewis.
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
Python CGI programming
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Chapter 6 Server-side Programming: Java Servlets
1 Welcome to CSC 301 Web Programming Charles Frank.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Form Data Encoding GET – URL encoded POST – URL encoded
Introduction to JavaScript CS101 Introduction to Computing.
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 27 HTTP and WWW.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
FALL 2004CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics (Web technologies: HTTP, CGI, Java applets; Middleware)
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
WWW and HTTP King Fahd University of Petroleum & Minerals
Chapter 27 WWW and HTTP.
Chapter 2 Interacting with the Customer
Web documents types.
INFS 230 L Internet Technology
Presentation transcript:

Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents, these alternative forms allow computer programs to control the contents of a document dynamically. In one form, a Web server runs an auxiliary program (CGI program) to create a document whenever a request arrives from a browser. In the other form, a server provides the browser with a computer program (JAVA).

Three types of Web documents Static, dynamic, and active categorized depending on when the information in the document changes

Static Documents content of document is determined when document is written and remains unchanged until author revises document

Dynamic Documents document does not exist in a predefined form. document is created by a web server whenever a browser requests the document. When a request arrives, the Web server runs an application program that creates the dynamic document. The server returns the output of the program as a response to the browser. The contents of a dynamic document can vary whenever a server receives a request for the document

Active Document consists of a computer program that understands how to compute and display values. When a browser request an active document, the server returns a copy of the program that the browser must run locally. Information displayed can change after the document has been loaded into a browser.

Comparison of Document Types ProCon Static simple, fast, reliableinflexible Dynamic able to report current information eg. Current stock price & weather conditions increased cost and inability to display changing information after browser receives copy of dynamic document. Ie. Document starts to age (stale) after browser gets document Active able to update information continuously without user interaction (eg. Animation or updated stock prices added cost of creating and running such documents.

Common Gateway Interface (CGI) Standard is used for building dynamic Web documents. specifies how a server interacts with an application program that implements a dynamic document. The application is called a CGI program. CGI does not specify a particular programming language ( eg. could be C, Perl, or Unix shell (fig 33.1))(fig 33.1)

CGI program output can be an HTML document, a plain text file, or a graphics image. A header (eg. Content-type: text/html ) (Content- type: text/plain) consists of line(s) of text describing the document type followed by a blank line, or a header can specify that the requested document is at a different location (eg. Location: /new/bar.txt )

CGI application support A server that is capable of running CGI programs must be configured before it can invoke a CGI program or script. When the a browser contacts the server and request the specified URL, the server runs the CGI program

Parameters and Environment Variables browser can pass parameters to a CGI program via URL. If the prefix of the URL corresponds to a CGI program, the server invokes the CGI program and passes the suffix of the URL as an argument. The question mark character (?) in the URL separates the prefix from the suffix. The server uses its configuration information to map the prefix to a particular CGI program. The server passes everything after the question mark as an argument to the CGI program via environment variables instead of via command line

Environment Variables inherited by a CGI program SERVER_NAME – contains domain name of computer running web server GATEWAY_INTERFACE – contains version of CGI software server is using SCRIPT_NAME – the path in the URL after the server name. QUERY_STRING – contains information following “?” in the URL REMOTE_ADDR – contains IP address of the computer running the browser that sent the request.

State Information Information preserved from one invocation of a CGI program to the next –helps avoid having a user answer questions repeatedly when specifying additional requests. CGI program saves information between requests (state information) via one of two methods for info that must be maintained across invocations of a browser, the CGI program uses files for long term storage (fig 33.3)(fig 33.3) for info that must be kept only while a browser is running, a dynamic document program encodes such information in URLs that appear in the hypertext links in the document (fig 33.4)(fig 33.4)

Server-Side Scripting Technologies Alternative dynamic document technologies used when only a small portion of web page needs to be changed. Interpreters built into web servers that can make small changes to a predefined template containing both HTML and scripts Regular HTML passes through unchanged Script information is replaced with output from interpreting the script ASP, JSP, PHP, Cold Fusion