ajpatelit.files.wordpress.com€¦  · web viewthe client/server model provides the technological...

31
1 Department of Information Technology Web Technology (2160708) Practical: 1 Aim: Client and server with reference to web Technology (In detail), Study different protocols (HTTP, SSL, FTP) The Vision of the Client/Server Computing We are in the midst of a fundamental change in both technology and its application. Organizations today expect to get more value from their investments in technology. Opportunities are available to organizations and people who are ready and able to compete in the global market. A competitive global economy will ensure obsolescence and obscurity to those who cannot or are unwilling to compete. All organizations must look for ways to demonstrate value. We are finally seeing a willingness to rethink existing organizational structures and business practices. Organizations are aggressively downsizing even as they try to aggressively expand their revenue base. There is more willingness to continue improvement practices and programs to eliminate redundancy and increase effectiveness. Organizations are becoming market-driven while remaining true to their business vision. Client/server computing is the most effective source for the tools that empower employees with authority and responsibility. Alpha College of Engineering and Technology

Upload: others

Post on 14-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

1

Department of Information Technology Web Technology (2160708)

Practical: 1

Aim: Client and server with reference to web Technology (In detail), Study different protocols (HTTP, SSL, FTP)

The Vision of the Client/Server Computing

We are in the midst of a fundamental change in both technology and its application.

Organizations today expect to get more value from their investments in technology.

Opportunities are available to organizations and people who are ready and able to

compete in the global market. A competitive global economy will ensure

obsolescence and obscurity to those who cannot or are unwilling to compete. All

organizations must look for ways to demonstrate value. We are finally seeing a

willingness to rethink existing organizational structures and business practices.

Organizations are aggressively downsizing even as they try to aggressively expand

their revenue base. There is more willingness to continue improvement practices and

programs to eliminate redundancy and increase effectiveness. Organizations are

becoming market-driven while remaining true to their business vision.

Client/server computing is the most effective source for the tools that empower

employees with authority and responsibility.

Workstation power, workgroup empowerment, preservation of existing investments,

remote network management, and market-driven business are the forces creating the

need for client/server computing.

The Client/server computing is an irresistible movement that is reshaping the way

computers is being used. Though this computing is very young it is already in full

force and is not leaving any area and corner of the computer industry untouched.

The Client/Server application development requires hybrid skills that include

transaction processing, database design, communication experience, graphical user

interface design, and being Internet Savvy. The more advanced applications require

knowledge of distributed objects and component infrastructures.

Let us now know what a client is and what is a server?

Alpha College of Engineering and Technology

Page 2: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

2

Department of Information Technology Web Technology (2160708)

Client - A client is a single-user workstation that provides presentation

services and the appropriate computing, connectivity and the database

services and the interfaces relevant to the business need.

Server- A server is one or more multi-user processors with share memory

providing computing, connectivity and the database services and the

interfaces relevant to the business need.

Alpha College of Engineering and Technology

Page 3: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

3

Department of Information Technology Web Technology (2160708)

The Merits of Client/Server Computing

Client/server computing provides the capability to use the most cost effective user

interface, data storage, connectivity, and application services. Frequently,

client/server products are deployed within the present organization but are not used

effectively.

Alpha College of Engineering and Technology

Page 4: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

4

Department of Information Technology Web Technology (2160708)

The client/server model provides the technological means to use previous

investments in concert with current technology options. Organizations see

opportunities to use technology to provide business solutions. Service and quality

competition in the marketplace further increases the need to take advantage of the

benefits available from applications built on the client/server model.

Client/server computing in its best implementations moves the data-capture and

information-processing functions directly to the knowledgeable worker—that is, the

worker with the ability to respond to errors in the data, and the worker with the

ability to use the information made available.

1. Enhanced Data Sharing

2. Integrated Services

3. Sharing Resources among Diverse Platforms

4. Data Interchangeability and Interoperability

5. Location Independence of Data and Processing

Hypertext Transfer Protocol

The Hypertext Transfer Protocol (HTTP) is an application-level protocol for

distributed, collaborative, hypermedia information systems. This is the foundation for

data communication for the World Wide Web (i.e. internet) since 1990. HTTP is a

generic and stateless protocol which can be used for other purposes as well using

extensions of its request methods, error codes, and headers.

Basically, HTTP is a TCP/IP based communication protocol, that is used to deliver

data (HTML files, image files, query results, etc.) on the World Wide Web. The

default port is TCP 80, but other ports can be used as well. It provides a standardized

way for computers to communicate with each other. HTTP specification specifies

how clients' request data will be constructed and sent to the server, and how the

servers respond to these requests.

Basic Features

There are three basic features that make HTTP a simple but powerful protocol:

Alpha College of Engineering and Technology

Page 5: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

5

Department of Information Technology Web Technology (2160708)

HTTP is connectionless: The HTTP client, i.e., a browser initiates an HTTP

request and after a request is made, the client disconnects from the server and

waits for a response. The server processes the request and re-establishes the

connection with the client to send a response back.

HTTP is media independent: It means, any type of data can be sent by HTTP

as long as both the client and the server know how to handle the data content.

It is required for the client as well as the server to specify the content type

using appropriate MIME-type.

HTTP is stateless: As mentioned above, HTTP is connectionless and it is a

direct result of HTTP being a stateless protocol. The server and client are

aware of each other only during a current request. Afterwards, both of them

forget about each other. Due to this nature of the protocol, neither the client

nor the browser can retain information between different requests across the

web pages.

Basic Architecture

The following diagram shows a very basic architecture of a web application and

depicts where HTTP sits:

Alpha College of Engineering and Technology

Page 6: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

6

Department of Information Technology Web Technology (2160708)

The HTTP protocol is a request/response protocol based on the client/server based

architecture where web browsers, robots and search engines, etc. act like HTTP

clients, and the Web server acts as a server.

Client

The HTTP client sends a request to the server in the form of a request method, URI,

and protocol version, followed by a MIME-like message containing request

modifiers, client information, and possible body content over a TCP/IP connection.

Server

The HTTP server responds with a status line, including the message's protocol

version and a success or error code, followed by a MIME-like message containing

server information, entity meta information, and possible entity-body content.

Secure Socket Layer

Alpha College of Engineering and Technology

Page 7: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

7

Department of Information Technology Web Technology (2160708)

SSL (Secure Sockets Layer) is a standard security technology for establishing an

encrypted links between a server and a client—typically a web server (website) and a

browser; or a mail server and a mail client (e.g., Outlook).

SSL allows sensitive information such as credit card numbers, social security

numbers, and login credentials to be transmitted securely. Normally, data sent

between browsers and web servers is sent in plain text—leaving you vulnerable to

eavesdropping. If an attacker is able to intercept all data being sent between a

browser and a web server they can see and use that information.

More specifically, SSL is a security protocol. Protocols describe how algorithms

should be used; in this case, the SSL protocol determines variables of the encryption

for both the link and the data being transmitted.

SSL secures millions of peoples’ data on the Internet every day, especially during

online transactions or when transmitting confidential information. Internet users have

come to associate their online security with the lock icon that comes with an SSL-

secured website or green address bar that comes with an extended validation SSL-

secured website. SSL-secured websites also begin with https rather than http

How Does the SSL Certificate Create a Secure Connection?

When a browser attempts to access a website that is secured by SSL, the browser and

the web server establish an SSL connection using a process called an “SSL

Handshake” (see diagram below). Note that the SSL Handshake is invisible to the

user and happens instantaneously.

Essentially, three keys are used to set up the SSL connection: the public, private, and

session keys. Anything encrypted with the public key can only be decrypted with the

private key, and vice versa.

Because encrypting and decrypting with private and public key takes a lot of

processing power, they are only used during the SSL Handshake to create a

symmetric session key. After the secure connection is made, the session key is used

to encrypt all transmitted data.

Alpha College of Engineering and Technology

Page 8: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

8

Department of Information Technology Web Technology (2160708)

Alpha College of Engineering and Technology

Page 9: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

9

Department of Information Technology Web Technology (2160708)

1. Browser connects to a web server (website) secured with SSL (https).

Browser requests that the server identify itself.

2. Server sends a copy of its SSL Certificate, including the server’s public key.

3. Browser checks the certificate root against a list of trusted CAs and that the

certificate is unexpired, unrevoked, and that its common name is valid for the

website that it is connecting to. If the browser trusts the certificate, it creates,

encrypts, and sends back a symmetric session key using the server’s public

key.

4. Server decrypts the symmetric session key using its private key and sends

back an acknowledgement encrypted with the session key to start the

encrypted session.

5. Server and Browser now encrypt all transmitted data with the session key.

File Transfer Protocol

FTP is an acronym for File Transfer Protocol. As the name suggests, FTP is used to

transfer files between computers on a network. You can use FTP to exchange files

between computer accounts, transfer files between an account and a desktop

computer, or access online software archives. Keep in mind, however, that many FTP

sites are heavily used and require several attempts before connecting.

FTP is built on a client-server architecture and uses separate control and data

connections between the client and the server. FTP users may authenticate

themselves using a clear-text sign-in protocol, normally in the form of a username

and password, but can connect anonymously if the server is configured to allow it.

For secure transmission that protects the username and password, and encrypts the

content, FTP is often secured with SSL/TLS (FTPS).

Alpha College of Engineering and Technology

Page 10: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

10

Department of Information Technology Web Technology (2160708)

Practical: 2Aim: Develop HTML page using HTML tags.Task Includes:-- Formatting and fonts- Commenting code, color- Hyperlink- Lists- Tables- Images, and many more

Remove this and below line and start your Scripting

Practical Script must be written in Courier New Font, Size 10, Bold: True, Spacing 1.5

Alpha College of Engineering and Technology

Page 11: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

11

Department of Information Technology Web Technology (2160708)

Practical: 3Aim: Develop HTML page.- Simple HTML forms design- Create frame and framesets- Use of get and post method

Alpha College of Engineering and Technology

Page 12: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

12

Department of Information Technology Web Technology (2160708)

Practical: 4Aim: CSS:- Apply CSS in previously created HTML pages or you can also create new pages.- Background image- Colors and properties- Manipulation texts, fonts- Borders and boxes- Margins and padding

Alpha College of Engineering and Technology

Page 13: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

13

Department of Information Technology Web Technology (2160708)

Practical: 5Aim: Java-script:-1. Examples of JS(Form validation)2. Examples of JS(Get day, month and year)3. Examples of JS( Java-script own object)

Alpha College of Engineering and Technology

Page 14: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

14

Department of Information Technology Web Technology (2160708)

Practical: 6Aim: Design static web-site using HTML, CSS, Java-script. (Lay-out will be given at the time of practical)

Alpha College of Engineering and Technology

Page 15: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

15

Department of Information Technology Web Technology (2160708)

Alpha College of Engineering and Technology

Page 16: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

16

Department of Information Technology Web Technology (2160708)

Output:

Alpha College of Engineering and Technology

Page 17: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

17

Department of Information Technology Web Technology (2160708)

Practical: 7Aim: XML, XSL, XSLT.- Create page using XML. And then transform with XSLT

Catalog.xml

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="sample.xsl"?>

<catalog>

Alpha College of Engineering and Technology

Page 18: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

18

Department of Information Technology Web Technology (2160708)

<book id="bk101">

<author>Gambardella, Matthew</author>

<title>XML Developer's Guide</title>

<genre>Computer</genre>

<price>44.95</price>

<publish_date>2000-10-01</publish_date>

<description>An in-depth look at creating applications

with XML.</description>

</book>

<book id="bk102">

<author>Ralls, Kim</author>

<title>Midnight Rain</title>

<genre>Fantasy</genre>

<price>5.95</price>

<publish_date>2000-12-16</publish_date>

<description>A former architect battles corporate zombies,

an evil sorceress, and her own childhood to become queen

of the world.</description>

</book>

<book id="bk103">

<author>Corets, Eva</author>

<title>Maeve Ascendant</title>

<genre>Fantasy</genre>

<price>5.95</price>

<publish_date>2000-11-17</publish_date>

<description>After the collapse of a nanotechnology

society in England, the young survivors lay the

Alpha College of Engineering and Technology

Page 19: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

19

Department of Information Technology Web Technology (2160708)

foundation for a new society.</description>

</book>

<book id="bk104">

<author>Corets, Eva</author>

<title>Oberon's Legacy</title>

<genre>Fantasy</genre>

<price>5.95</price>

<publish_date>2001-03-10</publish_date>

<description>In post-apocalypse England, the mysterious

agent known only as Oberon helps to create a new life

for the inhabitants of London. Sequel to Maeve

Ascendant.</description>

</book>

<book id="bk105">

<author>Corets, Eva</author>

<title>The Sundered Grail</title>

<genre>Fantasy</genre>

<price>5.95</price>

<publish_date>2001-09-10</publish_date>

<description>The two daughters of Maeve, half-sisters,

battle one another for control of England. Sequel to

Oberon's Legacy.</description>

</book>

<book id="bk106">

<author>Randall, Cynthia</author>

<title>Lover Birds</title>

<genre>Romance</genre>

Alpha College of Engineering and Technology

Page 20: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

20

Department of Information Technology Web Technology (2160708)

<price>4.95</price>

<publish_date>2000-09-02</publish_date>

<description>When Carla meets Paul at an ornithology

conference, tempers fly as feathers get ruffled.</description>

</book>

<book id="bk107">

<author>Thurman, Paula</author>

<title>Splish Splash</title>

<genre>Romance</genre>

<price>4.95</price>

<publish_date>2000-11-02</publish_date>

<description>A deep sea diver finds true love twenty

thousand leagues beneath the sea.</description>

</book>

<book id="bk108">

<author>Knorr, Stefan</author>

<title>Creepy Crawlies</title>

<genre>Horror</genre>

<price>4.95</price>

<publish_date>2000-12-06</publish_date>

<description>An anthology of horror stories about roaches,

centipedes, scorpions and other insects.</description>

</book>

<book id="bk109">

<author>Kress, Peter</author>

<title>Paradox Lost</title>

<genre>Science Fiction</genre>

Alpha College of Engineering and Technology

Page 21: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

21

Department of Information Technology Web Technology (2160708)

<price>6.95</price>

<publish_date>2000-11-02</publish_date>

<description>After an inadvertant trip through a Heisenberg

Uncertainty Device, James Salway discovers the problems

of being quantum.</description>

</book>

<book id="bk110">

<author>O'Brien, Tim</author>

<title>Microsoft .NET: The Programming Bible</title>

<genre>Computer</genre>

<price>36.95</price>

<publish_date>2000-12-09</publish_date>

<description>Microsoft's .NET initiative is explored in

detail in this deep programmer's reference.</description>

</book>

<book id="bk111">

<author>O'Brien, Tim</author>

<title>MSXML3: A Comprehensive Guide</title>

<genre>Computer</genre>

<price>36.95</price>

<publish_date>2000-12-01</publish_date>

<description>The Microsoft MSXML3 parser is covered in

detail, with attention to XML DOM interfaces, XSLT processing,

SAX and more.</description>

</book>

<book id="bk112">

<author>Galos, Mike</author>

Alpha College of Engineering and Technology

Page 22: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

22

Department of Information Technology Web Technology (2160708)

<title>Visual Studio 7: A Comprehensive Guide</title>

<genre>Computer</genre>

<price>49.95</price>

<publish_date>2001-04-16</publish_date>

<description>Microsoft Visual Studio 7 is explored in depth,

looking at how Visual Basic, Visual C++, C#, and ASP+ are

integrated into a comprehensive development

environment.</description>

</book>

</catalog>

Design.xsl

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

<xsl:output method="html" indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>

<xsl:template match="/">

<html>

<head>

      <title>Sample xml transformation</title>

</head>

<body>

<table border="1">

<tr bgcolor="#9acd32">

<th>Author</th>

<th>Title</th>

Alpha College of Engineering and Technology

Page 23: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

23

Department of Information Technology Web Technology (2160708)

<th>Genration</th>

<th>Price</th>

<th>Publish_date</th>

<th>Description</th>

</tr>

<xsl:for-each select="catalog/book">

<tr>

        <td><xsl:value-of select="author" /></td>

        <td><xsl:value-of select="title" /></td>

        <td><xsl:value-of select="genre" /></td>

        <td><xsl:value-of select="price" /></td>

        <td><xsl:value-of select="publish_date" /></td>

        <td><xsl:value-of select="description" /></td>

</tr>

</xsl:for-each>

</table>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

Alpha College of Engineering and Technology

Page 24: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

24

Department of Information Technology Web Technology (2160708)

Output:

Alpha College of Engineering and Technology

Page 25: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

25

Department of Information Technology Web Technology (2160708)

Practical: 8Aim: PHP:-- Create php pages.- Establish connection with the server- Arrays- Functions and forms- Advance PHP

Alpha College of Engineering and Technology

Page 26: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

26

Department of Information Technology Web Technology (2160708)

Practical: 9Aim: Advance PHP:- Create a Program to upload the file

- Check if File Already Exists- Limit File Size and Type

Alpha College of Engineering and Technology

Page 27: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

27

Department of Information Technology Web Technology (2160708)

<!DOCTYPE html><html><body>

<form action="upload.php" method="post" enctype="multipart/form-data">    Select image to upload:    <input type="file" name="fileToUpload" id="fileToUpload">    <input type="submit" value="Upload Image" name="submit"></form>

</body></html>

Upload.php

<?php$target_dir = "uploads/";$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);$uploadOk = 1;$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);// Check if image file is a actual image or fake imageif(isset($_POST["submit"])) {    $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);    if($check !== false) {        echo "File is an image - " . $check["mime"] . ".";        $uploadOk = 1;    } else {        echo "File is not an image.";        $uploadOk = 0;    }}// Check if file already existsif (file_exists($target_file)) {    echo "Sorry, file already exists.";    $uploadOk = 0;}// Check file sizeif ($_FILES["fileToUpload"]["size"] > 500000) {

Alpha College of Engineering and Technology

Page 28: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

28

Department of Information Technology Web Technology (2160708)

    echo "Sorry, your file is too large.";    $uploadOk = 0;}// Allow certain file formatsif($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" ) {    echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";    $uploadOk = 0;}// Check if $uploadOk is set to 0 by an errorif ($uploadOk == 0) {    echo "Sorry, your file was not uploaded.";// if everything is ok, try to upload file} else {    if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {        echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";    } else {        echo "Sorry, there was an error uploading your file.";    }}

?>

Output:

Alpha College of Engineering and Technology

Page 29: ajpatelit.files.wordpress.com€¦  · Web viewThe client/server model provides the technological means to use previous investments in concert with current technology options

29

Department of Information Technology Web Technology (2160708)

Practical: 10

Aim: Web application part-1Definition: - Your application must have at least 5 web pages. (HTML, PHP) PHP page should make connection with DBMS (mysql)

Alpha College of Engineering and Technology