Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Client/Server Applications

Similar presentations


Presentation on theme: "Chapter 2 Client/Server Applications"— Presentation transcript:

1 Chapter 2 Client/Server Applications
Web Programming Chapter 2 Client/Server Applications Web Programming Modern Management and Information Technology College of Arts, Media and Technology, Chiang Mai University

2 Contents Client/Server Design in Web Applications
Web Programming Contents Client/Server Design in Web Applications Working with Files and Folders What Languages Will I Use? What Software Will I Need?

3 Client/Server Design in Web Applications

4 Client/Server Design in Web Applications
Recall from Chapter 1: a client application provides an interface to the user and waits for the user to request some action a client application calls a server application to process the request a server application sends back a response a client application receives the response and present to the user

5 Client/Server Design in Web Applications
Example of client/server design Source: Mike O’Kane (2011) A Web-Based Introduction to Programming

6 Client/Server Design in Web Applications
Recall from Chapter 1: A single server can deliver the same services to any number of clients. Changes can be made on the server with no need to make changes on the client (ex. update software on the server, not on every clients) A Web application is an example of an Internet-based client/server design

7 Client/Server Design in Web Applications
Web Programming Client/Server Design in Web Applications To develop a Web-based applications: - We must create files that contain the instructions for our Web pages and store them on a Web server. - Then, the server can response to the requests. In this course,

8 Working with Files and Folders

9 Working with Files and Folders
Web Programming Working with Files and Folders In this course you will use different extensions for your files: Plain text files HTML files PHP files

10 Working with Files and Folders
Web Programming Working with Files and Folders Plain text files - Using a .txt or .dat extension - Used to store simple data - Ex. you might create a file named “scores.txt” that contains a list of student scores.

11 Working with Files and Folders
Web Programming Working with Files and Folders HTML files - Using a .html extension - Used to store the markup instructions to allow the user to enter information - Ex. you might create a file named “wages.html“ that contains a Web page with a form for the user to submit their hours worked and hourly wage.

12 Working with Files and Folders
Web Programming Working with Files and Folders PHP files - Using a .php extension - Used to store the source code. PHP programs will receive information from the user or look up data in files to process operations and generate output. - Ex, you might create a file named “wages.php” that contains the source code to receive information, then calculate and display the pay.

13 Working with Files and Folders
Web Programming Working with Files and Folders Files are usually organized into folders for ease of management You can access files on disks located in local drives (in your personal computer) You can also access files on disks in remote disk drives, (in other computers => server) through a network such as the Internet

14 Working with Files and Folders
Web Programming Working with Files and Folders However, in this course, we will use a software that allows you to run a Web server on your local computer with no need for Internet access in order to work simply and securely

15 What Languages Will I Use?

16 What Languages Will I Use?
Web Programming What Languages Will I Use? You will write your Web programs using a combination of two languages: HTML (Hypertext Markup Language) PHP (PHP Hypertext Preprocessor)

17 What Languages Will I Use?
Web Programming What Languages Will I Use? HTML (Hypertext Markup Language) - Provides the markup instructions that you will use to create and format the Web pages that display the user interface for your Web applications - You will use HTML to display headings, paragraphs, forms, tables, buttons, and images - Everything you learn will be based on current HTML standards, which is known as XHTML

18 What Languages Will I Use?
Web Programming What Languages Will I Use? PHP (PHP Hypertext Preprocessor) PHP is a programming language that you will use to write server-based program that process user requests by: - performing calculations - validating input making decisions - reading data from files/databases - writing output to files/databases - returning results to the user, etc.

19 What Languages Will I Use?
Web Programming What Languages Will I Use? From an example of a simple client/server application from Chapter 1, there are two web pages: 1 2 Source: Mike O’Kane (2011) A Web-Based Introduction to Programming

20 What Languages Will I Use?
Web Programming What Languages Will I Use? The first Web page is generated from HTML code located in an .html file on a Web server 1 A form that the user can enter information (input) and click a button

21 What Languages Will I Use?
Web Programming What Languages Will I Use? When the user click the button, the browser sends the input (10.75 and 25) back to the server with a request to process a PHP code file The PHP file receives input, calculates a wage based on the input, and generates a new HTML page to display the results (The second page)

22 What Languages Will I Use?
Web Programming What Languages Will I Use? The second Web page is created by the PHP file and the server returns this to the Web browser for display to the user 2

23 What Languages Will I Use?
Web Programming What Languages Will I Use?

24 What Software Will I Need?

25 What Software Will I Need?
Web Programming What Software Will I Need? A text editor to create HTML and PHP files. A Web browser to submit requests to the Web server and display the result Web pages A Web server that can process requests


Download ppt "Chapter 2 Client/Server Applications"

Similar presentations


Ads by Google