Internet & World Wide Web How to Program, 5/e. ©1992-2012by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.

Slides:



Advertisements
Similar presentations
Enabling Secure Internet Access with ISA Server
Advertisements

 2004 Prentice Hall, Inc. All rights reserved. Chapter 21 – Web Servers (IIS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 21 – Web Servers (IIS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System.
Web App Development with ASP.NET. Introduction In this chapter, we introduce web-app development with Microsoft’s ASP.NET technology. Web-based apps create.
Server-Side vs. Client-Side Scripting Languages
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Introduction to Web Database Processing
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
 2002 Prentice Hall. All rights reserved. 1 Chapter 6 – Introduction to the Common Gateway Interface (CGI) Outline 6.1 Introduction 6.2 Client and Web.
Introduction to Web Interface Technology (CSE2030)
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
 2008 Pearson Education, Inc. All rights reserved Web Servers (IIS and Apache)
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
Hands-On Microsoft Windows Server 2008 Chapter 8 Managing Windows Server 2008 Network Services.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
17 Web Servers (Apache and IIS)
1 Web Servers (IIS and Apache) Outline 9.1 Introduction 9.2 HTTP Request Types 9.3 System Architecture 9.4 Client-Side Scripting versus Server-Side Scripting.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
CSCI 323 – Web Development Chapter 1 - Setting the Scene We’re going to move through the first few chapters pretty quick since they are a review for most.
INTRODUCTION TO WEB DATABASE PROGRAMMING
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application Introducing Visual Web Developer 2008 Express and the.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 29.1 Multi-Tier Architecture 29.2 Web Servers.
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Databases and the Internet. Lecture Objectives Databases and the Internet Characteristics and Benefits of Internet Server-Side vs. Client-Side Special.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Chapter 1: Introduction to Web
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
MySQL and PHP Internet and WWW. Computer Basics A Single Computer.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 Welcome to CSC 301 Web Programming Charles Frank.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
 2008 Pearson Education, Inc. All rights reserved. Chapter 17 Web Servers (Apache and IIS) Internet & World Wide Web How to Program, 5/e.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Introduction and Principles Web Server Scripting.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Unit 1 – Web Concepts Instructor: Brent Presley.
Microsoft Office 2008 for Mac – Illustrated Unit D: Getting Started with Safari.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Copyright © 2011 Pearson Addison-Wesley Web Servers and Projects Deployment Chapter 11 – Slide 1.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
1 UNIT 13 The World Wide Web. Introduction 2 The World Wide Web: ▫ Commonly referred to as WWW or the Web. ▫ Is a service on the Internet. It consists.
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.
Web Technology Seminar
Web Development Web Servers.
Warm Handshake with Websites, Servers and Web Servers:
E-commerce | WWW World Wide Web - Concepts
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
E-commerce | WWW World Wide Web - Concepts
Developing Web-Based Applications
PHP / MySQL Introduction
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
17 Web Servers (Apache and IIS)
PHP and Forms.
17 Web Servers (Apache and IIS)
Web Servers (IIS and Apache)
Presentation transcript:

Internet & World Wide Web How to Program, 5/e

© by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.3 Revised by Dr. T. Tran for CSI3140

 A web server responds to client requests (typically from a web browser) by providing resources such as HTML documents.  When users enter a Uniform Resource Locator (URL) address, such as into a web browser, they’re requesting a specific document from a web server.  The web server maps the URL to a resource on the server (or to a file on the server’s network) and returns the requested resource to the client.  A web server and a client communicate using the platform-independent Hypertext Transfer Protocol (HTTP), a protocol for transferring requests and files over the Internet or an intranet. 4 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 URIs (Uniform Resource Identifiers) identify resources on the Internet.  URIs that start with are called URLs (Uniform Resource Locators).  Common URLs refer to files, directories or server- side code that performs tasks, such as database lookups, Internet searches and business-application processing.  A URL contains information that directs a browser to the resource that the user wishes to access.  Consider the following URL:  indicates that the HyperText Transfer Protocol (HTTP) should be used to obtain the resource. 5 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 Next in the URL is the server’s fully qualified hostname (e.g.,  the name of the web-server computer on which the resource resides.  A hostname is translated into an IP (Internet Protocol) address—a numerical value that uniquely identifies the server  An Internet domain name system (DNS) server maintains a database of hostnames and their corresponding IP addresses and performs the translations automatically  The remainder of the URL (/books/downloads.html) specifies the resource’s location (/books) and resource’s name (downloads.html) on the web server  For security reasons, the location is typically a virtual directory. The web server translates the virtual directory into a real location on the server, thus hiding the true location of the resource. 6 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 When given a web page URL, a web browser uses HTTP to request and display the web page found at that address.  HTTP method GET indicates that the client wishes to obtain a resource from the server. The remainder of the request provides the path name of the resource, the protocol’s name and its version number. E.g., GET /books/downloads.html HTTP/1.1  Any server that understands HTTP can receive a GET request and respond appropriately.  First, the server sends a line of text that indicates the HTTP version, followed by a numeric status code, and a phrase describing the status of the transaction. E.g., HTTP/ OK  HTTP status code 200 indicates success. Status code 404 informs the client that the web server could not locate the requested resource. A complete list of numeric codes indicating the status of an HTTP transaction can be found at: 7 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 Next, the server sends one or more HTTP headers, which provide additional information about the data that will be sent.  The Multipurpose Internet Mail Extensions (MIME) standard specifies data formats, which programs can use to interpret data correctly.  The MIME type text/plain indicates that the sent information is text that can be displayed directly.  The MIME type image/jpeg indicates that the content is a JPEG image. When the browser receives this MIME type, it attempts to display the image.  The header or set of headers is followed by a blank line, which indicates to the client browser that the server is finished sending HTTP headers.  Finally, the server sends the content of the requested document (e.g., downloads.html) 8 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.9 Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.10 Revised by Dr. T. Tran for CSI3140

 Two most common HTTP request types:  get and post  get request typically gets (or retrieves) information from a server. Common uses of get requests are to retrieve an HTML document or an image, or search results based on a user-submitted search term.  post request typically posts (or sends) data to a server. Common uses of post requests are to send information to a server, such as authentication information, or data from a form that gathers user input.  An HTTP request often posts data to a server-side form handler that processes the data.  A get request appends data to the URL in a query string, for example:  In this example, search is the name of Google’s server-side form handler, q is the name of a variable in Google’s search form, and deitel is the search term.  The ? separates the query string from the rest of the URL in a get request.  A name/value pair is passed to the server with the name and the value separated by an equals sign ( = ). If more than one name/value pair is submitted, each pair is separated by an ampersand ( & ). 11 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 A get request may be initiated by submitting an HTML form whose method attribute is set to "get", or by typing the URL (possibly containing a query string) directly into the browser’s address bar  A post request sends form data as an HTTP message (in the body of the HTTP request), not as part of the URL.  A get request typically limits the query string (i.e., everything to the right of the ?)to a specific number of characters. So, it is often necessary to send large amounts of information using the post method.  The post method is sometimes preferred because it hides the submitted data from the user by embedding it in a HTTP message. 12 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.13 Revised by Dr. T. Tran for CSI3140

 Browsers often cache recently viewed web pages so they can quickly reload the pages.  If there are no changes between the version stored in the cache and the current version on the web, this helps speed up your browsing experience. 14 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 Web-based applications are often multitier applications that divide functionality into separate tiers. Although tiers can be located on the same computer, the tiers of web-based applications typically reside on separate computers.  The bottom tier (also called the data tier or the information tier) maintains the application’s data.  The middle tier implements business logic, controller logic and presentation logic to control interactions between the application’s clients and its data.  Business logic in the middle tier enforces business rules and ensures that data is reliable before the server application updates the database or presents the data to users. Business rules dictate how clients can and cannot access application data, and how applications process data.  The top tier, or client tier, is the application’s user interface. In response to user actions, the client tier interacts with the middle tier to make requests and to retrieve data from the information tier. The client tier then displays the retrieved data for the user. The client tier never directly interacts with the information tier. 15 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.16 Revised by Dr. T. Tran for CSI3140

 Client-side scripting can be used to validate user input, to interact with the browser, to enhance web pages, and to add client/server communication between a browser and a web server.  Client-side scripting does have limitations, such as browser dependency: the browser or scripting host must support the scripting language and capabilities.  Client-side scripts can be viewed by the client, by using the browser’s source-viewing capability.  Sensitive information, such as passwords or other personally identifiable data, should not be stored or validated on the client. 17 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 Placing large amounts of JavaScript on the client can open web applications to security issues.  Server-side scripts give programmers more flexibility and often generate custom responses for clients.  A client may connect to an airline’s web server and request a list of flights from Ottawa to San Francisco between March 25 and April 5.  Server-side scripting languages have a wider range of programmatic capabilities than their client-side equivalents. 18 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 To request documents from web servers, users must know the hostnames on which the web server software resides.  Users can request documents from local web servers (i.e., ones residing on users’ machines) or remote web servers (i.e., ones residing on different machines).  Local web servers can be accessed through your computer’s name, or through the name localhost —a hostname that references the local machine and normally translates to the IP address (also known as the loopback address). 19 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 The Apache HTTP Server, maintained by the Apache Software Foundation, is currently the most popular web server. It is open source software that runs on UNIX, Linux, Mac OS X, Windows and numerous other platforms.  MySQL is the most popular open source database management system. It, too, runs on Linux, Mac OS X and Windows.  PHP is the most popular server-side scripting language for creating dynamic, data-driven web applications.  The Apache HTTP Server, MySQL database server, and PHP can each be downloaded and installed separately, but this also requires additional configuration on your part.  For simplicity, we’ll use the XAMPP integrated installer provided by the Apache Friends website ( ).  Go to  Choose the installer for your platform. Carefully follow the provided installation instructions and be sure to read the entire installation page for your platform!  If you’d prefer to use PHP with Microsoft’s IIS Express and SQL Server Express, you can use their Web Platform Installer to set up and configure PHP: 20 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

Windows  Go to your c:\xampp folder (or the folder in which you installed XAMPP) and double click xampp_start.exe. If you need to stop the servers (e.g., so you can shut down your computer), use xampp_stop.exe in the same folder. Mac OS X  Go to your Applications folder (or the folder in which you installed XAMPP), then open the XAMPP folder and run XAMP Control.app. Click the Start buttons in the control panel to start the servers. If you need to stop the servers (e.g., so you can shut down your computer), you can stop them by clicking the Stop buttons. Linux  Open a shell and enter the command /opt/lampp/lampp start  If you need to stop the servers (e.g., so you can shut down your computer), open a shell and enter the command /opt/lampp/lampp stop 21 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 Once you’ve started the servers, you can open any web browser on your computer and enter the address to confirm that the web server is up and running.  If it is, you will see a web page similar to the one in Fig You’re now ready to go! 22 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.23 Revised by Dr. T. Tran for CSI3140

 Now that the Apache HTTP Server is running on your computer, you can copy the book’s examples into XAMPP’s htdocs folder.  Assuming you copy the entire Examples folder into the htdocs folder, you can run the examples in Chapters 2–16 and 19 with URLs of the form where chapter is one of the chapter folders (e.g., ch03), figure is a folder for a particular example (e.g., fig03_01) and filename is the page to load (e.g., NewFormInputTypes.html).  So, you can run the first example in Chapter 3 with Types.html  Note: The ch02 examples folder does not contain any subfolders. 24 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 Microsoft Internet Information Services Express (IIS Express) is a web server that that can be installed on computers running Windows.  Once it is running, you can use it to test web pages and web applications on your local computer.  IIS Express can be downloaded and installed by itself.  Or, it can be installed in a bundle with Microsoft’s WebMatrix - a free development tool for building PHP and ASP.NET web apps. 25 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 If you simply want to test your web pages on IIS Express, you can install it from: ISExpress  We recommend using the default installation options. Once you’ve installed IIS Express you can learn more about using it at: to-iis-express 26 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 You can install the WebMatrix and IIS Express bundle from: ISExpress  Again, we recommend using the default installation options.  You can run WebMatrix by opening the Start menu and selecting All Programs > Microsoft WebMatrix > Microsoft WebMatrix. This will also start IIS Express.  Microsoft provides tutorials on how to use WebMatrix at: using-webmatrix 27 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 To execute IIS Express, open a Command Prompt window and change directories to the IIS Express folder. On 32-bit Windows versions, use the command  cd "c:\Program Files\IIS Express"  On 64-bit Windows versions, use the command  cd "c:\Program Files (x86)\IIS Express"  If the book’s examples are in a folder named c:\Examples, you can use this command to run IIS Express with the path set to the Examples folder on the Command Prompt window:  iisexpress /path:c:\Examples  You can now run your examples with URLs of the form  28 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

 One easy way to test Chapter 19’s PHP examples is to use WebMatrix to enable PHP for the ch19 folder in the book’s examples. To do so, perform the following steps.  Run WebMatrix by opening the Start menu and selecting All Programs > Microsoft WebMatrix > Microsoft WebMatrix.  In the Quick Start - Microsoft WebMatrix window, select Site From Folder.  Locate and select the ch19 folder in the Select Folder window, then click the Select Folder button.  This opens the ch19 folder as a website in WebMatrix (Fig. 17.5) 29 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.30 Revised by Dr. T. Tran for CSI3140

 To enable PHP, perform the following steps:  Click the Site option in the bottom-left corner of the window.  Click Settings and ensure that Enable PHP is checked (Fig. 17.6). (Note: The first time you do this, WebMatrix will ask you for permission to install PHP. You must do this to test the PHP examples.) 31 © by Pearson Education, Inc. All Rights Reserved. Revised by Dr. T. Tran for CSI3140

© by Pearson Education, Inc. All Rights Reserved.32 Revised by Dr. T. Tran for CSI3140