1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 11: Advanced Web Technologies.
CS 22: Enhanced Web Site Design - Week 8Slide 1 of 15 Enhanced Web Site Design Stanford University Continuing Studies CS 22 Mark Branom
Java Script Session1 INTRODUCTION.
Adding Dynamic Content to your Web Site
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Introduction to Web Database Processing
INTERNET DATABASE. Internet and E-commerce Internet – a worldwide collection of interconnected computer network Internet – a worldwide collection of interconnected.
Introduction to Web Interface Technology (CSE2030)
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
Definitions, Definitions, Definitions Lead to Understanding.
Website Development with PHP and MySQL Introduction.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
Lecture 13 Dynamic Web Servers & Common Gateway Interface CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Chapter 6: Hostile Code Guide to Computer Network Security.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
INTRODUCTION TO WEB DATABASE PROGRAMMING
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
1 Servlet How can a HTML page, displayed using a browser, cause a program on a server to be executed?
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
HTTP; The World Wide Web Protocol
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Web Application Programming Carol Wolf Computer Science.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Lecture 5 Dynamic Web Servers CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Lecture 8 – Cookies & Sessions SFDV3011 – Advanced Web Development 1.
2-1 WEB DATABSE INTERFACING Colorado Technical University IT420.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
1 Basic Perl CGI Programming. 2 Issues How and when your program is invoked. Generating Response –HTTP Headers –HTML (or whatever document type you want)
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
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.
Netprog 2002 CGI Programming1 CGI Programming CLIENT HTTP SERVER CGI Program http request http response setenv(), dup(), fork(), exec(),...
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Part 4 Processing and saving data with CGI/Perl Psychological Science on the Internet: Designing Web-Based Experiments From the Ground Up R. Chris Fraley.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Web111a_chapt08.ppt HTML: Section 8 JavaScript CGI Programs (Server Side programs) Common Gateway Interface Run on server Communicate with user across.
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.
WEB SERVER SOFTWARE FEATURE SETS
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Lecture 19 Overview. Hyper Text Transfer Protocol HTTP is the protocol that supports communication between web browsers and web servers. – A “Web Server”
ITM © Port,Kazman 1 ITM 352 Cookies. ITM © Port,Kazman 2 Problem… r How do you identify a particular user when they visit your site (or any.
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
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.
Distributed Control and Measurement via the Internet
WWW and HTTP King Fahd University of Petroleum & Minerals
PHP / MySQL Introduction
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 27 WWW and HTTP.
JavaScript.
Web Page Concept and Design :
Presentation transcript:

1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk. Today - many of the documents on the WWW are built at request time. –URL doesn’t correspond to a single file.

2 Dynamic Documents Dynamic Documents can provide: –automation of web site maintenance –customized advertising –database access –shopping carts –date and time service –well paying jobs for netprog students. Cool idea!

3 Web Programming Writing programs that create dynamic documents has become very important. There are a number of general approaches: –Create custom server for each service desired. Each is available on different port. –Have web server run external programs. –Develop a real smart web server SSI, scripting, server APIs.

4 Custom Server Write a TCP server that watches a “well known” port for requests. Develop a mapping from http requests to service requests. Send back HTML (or whatever) that is created/selected by the server process. Have to handle http errors, headers, etc.

5 An Example Custom Server We want to provide a time and date service. Anyone in the world can find out the date and time (according to our computer)!!! We don’t care what is in the http request, our reply doesn’t depend on it. We assume the request comes from a browser that wants the content formatted as an HTML document.

6 WWW based time and date server DaveH Enterprises –Listen on a well known TCP port. –Accept a connection. –Find out the current time and date –Convert time and date to a string –Send back some http headers (Content-Type) –Send the string wrapped in HTML formatting. –Close the connection. loop forever

7 Accessing our custom server. We can publish the URL to our server, or embed links to the server in other HTML documents. We need to make sure the server is always running (on the published host and port). Once we are famous we can include advertisements and make money!

8 Another Money Making Scheme Example Keep track of how many times our server is hit each day. Report on the number of hits our server got on any day in the past! The reply now does depend on the request! We have to remember that the request comes from a HTTP client, so we need to accept HTTP requests.

9 Time & Date Hit Server Each request comes as a string (1 line) specifying a resource. Our requests will look like this: /mm/dd/yy An example absolute URL for our service: We will get a request like: GET /04/01/98 HTTP/1.1

10 Fancy means $$$ We want to provide a table that lists the number of hits for the day in question received each hour of the day. timedate.com hit report for 04/01/98 hour number of hits 12-1AM4, AM 18, AM 246

11 HTML Basics I assume everyone knows something about HTML. –If not: check the home page for some links. HTML Tables: –, start/end a table –, start/end a table row –, start/end a table cell –, start/end table header cell

12 timedate.com Hit Table hour number of hits 12-1AM 4, AM 18,986 hour number of hits 12-1AM 4, AM 18, AM246

13 New code –Listen on a well known TCP port. –Accept a connection. –Read request - parse request to month,day,year –Lookup hits for month,day,year in database. –Send back some http headers (Content-Type) –Create HTML table and send back to client. –Close the connection. –Collect millions in advertising revenues.

14 Drawbacks to Custom Server Approach Might have lots of custom services. –Each requires dedicated address (port) –Each needs to include code: basic TCP server code parsing HTTP requests error handling headers access control (might want users to pay each time they check the time and date!)

15 Another Approach Take a general purpose Web server (that can handle static documents) and have it process requested documents as it sends them to the client. The documents could contain commands that the server understands (the server is an interpreter).

16 Example Smart Server Have the server read each HTML file as it sends it to the client. The server could look for this: some command The server doesn’t send this part to the client, instead it interprets the command and sends the result to the client. Everything else is sent normally.

17 Example Commands Time Date Hitlist Include file randomfile directory

18 Example Document timedate.com Home Page Welcome to timedate.com include fancygraphic The current time is time. Today is date. Visit our sponser: random sponsor

19 Real Life - Server Side Includes Many real web servers support this idea (but not the syntax I’ve shown). Server Side Includes (SSI) provides a set of commands that a server will interpret. Typically the server is configured to look for commands only in specially marked documents (so normal documents aren’t slowed down).

20 SSI Directives SSI commands are called directives Directives are embedded in HTML comments. A comment looks like this: A directive looks like this:

21 Some SSI Directives echo : inserts the value of an environment variable into the page. SSI servers keep a number of useful things in environment variables: DOCUMENT_NAME, DOCUMENT_URL Example usage: This page is located at.

22 SSI Directives include : inserts the contents of a text file. flastmod : inserts the time and date that a file was last modified. Last modified exec : runs an external program and inserts the output of the program. Current users

23 More Power Some servers support elaborate scripting languages. Scripts are embedded in HTML documents, the server interprets the script: –Microsoft Active Server Pages (ASP) JScript, VBScript, PerlScript –Netscape LiveWire JavaScript, SQL connection library. –There are others...

24 Server Mapping and APIs Some servers include a programming interface that allows us to extend the capabilities of the server by writing modules. Specific URLs are mapped to specific modules instead of to files. We could write our timedate.com server as a module and merge it with the web server.

25 External Programs Another approach is to provide a standard interface between external programs and web servers. –We can run the same program from any web server. –The web server handles all the http, we focus on the special service only. –It doesn’t matter what language we use.

26 Common Gateway Interface CGI is a standard interface to external programs supported by most (if not all) web servers. The interface that is defined by CGI includes: –identification of the service (external program). –Mechanism for passing the request to the external program.

27 CGI Programming We will focus on CGI programming. Project 4 will be a CGI program, you will create a web-based todo list manager. CGI programs are often written in scripting languages (perl, tcl), we will concentrate on C.