Sei sulla pagina 1di 23

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

IT2353 WEB TECHNOLOGY


QUESTION BANK
Unit 1
Two Marks
1. Define URI.

(AM 2011)

URI (Uniform Resource Identifier): It identifies an object on the Internet.


2. State the use of web server logs and list the contents of a message log.

(AM 2011)

A web server log is a log file automatically created and maintained by a server consisting of
a list of activities it performed.
List of Contents:

Client IP address
Request date/time

Page requested

HTTP code

Bytes served

User agent

3. How will you create a password field in a HTML form?

(ND2011)

Password fields are unique type of data entry fields. All information within the
password field will be displayed as an asterik(*).
Password field can be created as :
<input type="password" name="<Name of the field>" value="<Default value of the
object>">

4. List any four common browsers.

(ND2011)

Mozilla Firefox, google chrome, safari, internet explorer, opera .

NITHYAKANI.P

UNIT-I

Page 1

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


5. State the function of DNS and the protocol used.

(ND 2012)

Domain Name Service (DNS) is the service used to convert human readable names of hosts
to IP addresses. Protocols used: - TCP and UDP
6. Write HTML code to display an image.

(ND 2012)

<img align="center" size="100" src="IndiaMap.jpg" usemap="#india"/>


7. State the uses of internet protocol.

(AM 2012)

IP software is used to transfer data from source and destination.


IP supports unique addressing for computers on a network.

8. List and explain any two HTML elements.

(AM 2012)

<HTML> </HTML>
<BODY> </BODY>
<FORM> </FORM>
<TABLE> </TABLE>
<P>, <B>, <I>, <U> <SPAN>,
<STRONG>, <TT>, <LI>,
<OL>, <UL> <INPUT> <SELECT>
9. Write HTML code to create the following Table
w
x
y

(MJ 2013)

<html>
<table border="1" >
<tr>
<td>w</td>
<td>x</td>
</tr>
<tr>
<td>y</td>
<td>z</td>
</tr>
</html>
10. List the different basic protocol used in internet.
Transmission Control Protocol (TCP)
User Datagram Protocol (UDP)
Internet Control Message Protocol (ICMP)

NITHYAKANI.P

(MJ 2013)

UNIT-I

Page 2

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


11. What do you mean by relative URLs?

(MJ2014)

A Relative URL or a partial internet address, points to a resource relative to the current
directory or file.
Example : <a href="Home.html">back</a>
12. Write the functions of a web server.

(MJ2014)

A Web Server is software that accepts HTTP requests from web clients and returns an
appropriate resource in the HTTP response.
Functions of a web server:

Store, process and deliver web pages to clients.

Receive HTTP request via TCP

Log information about the request and response

13. Write the expansion for the following.


ARPA Advanced Research Projects Agency
UDP User Datagram Protocol
POP3 Post Office Protocol version 3
MIME Multimedia Internet Message Extension Protocol
IMAP Internet Message Access Protocol
14. What are the two major protocols for accessing email from servers? (APRIL/MAY)

HTTP - Hypertext Transfer Protocol

SMTP - Simple Mail Transfer Protocol.

15. Define HTTP Protocol.


HTTP is a form of stateless communication protocol.
It gives a detailed specification of how web client and server should communicate and the
basic structure followed is known as Request-Response model.

16. What are HTTP Status Codes?

This code provides the information about the HTTP Response from the server.

NITHYAKANI.P

UNIT-I

Page 3

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

All status code is three-digit decimal numbers.


The first digit represents the general class of status code.
The last two digits of a status code define the specific status within the specified

The five classes of HTTP 1.1 status codes.


Digit

Class

1.

International

17. List out

Success

GET,

Redirection

Client Error

Server Error

18. What

the available HTTP methods.


HEAD, POST, OPTIONS, PUT,
DELETE, TRACE
are Secure Servers?

The standard means of indicating to a browser that it should encrypt an HTTP request is to
use the https scheme on the URL for the request.
For e.g. https://www.example.org will cause the browser to attempt to send an encrypted
HTTP GET request.
19. What are HTML forms?
An HTML form is used to allow a user to input data on a web page and the element used is
form element and its main attributes are action and method.
Its format is
<form action=form.php>
</form>
20. What are the types of list supported by HTML?
There are three types of list supported by HTML.
i.
ii.
iii.

NITHYAKANI.P

Unordered A bullet list


Ordered a number list
Definition A list of terms and definitions for each

UNIT-I

Page 4

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

16 MARKS
1.

Explain in detail the working of the following Internet Protocols


(i)
TCP/IP (AM 2011) (ii) HTTP
TCP/IP:- [Transmission Control Protocol / Internet Protocol]
TCP is a higher level, heavy weight and Connection oriented protocol.
Used along with the Internet Protocol to send data and track packets
INTERNET PROTOCOL
Primary network protocol used on the network.
IP Address: An IP address is a binary number that uniquely identifies computers and
other devices on a TCP/IP network
32 bits in length
Written as four decimal numbers separated by dots.
E.g. 10.1.1.41
IP software:IP software is used to transfer data from source and destination.
Packet:

Creates a packet which is a sequence of bits along with source and destination IP
address.

Gateway:

Packet is sent to a gateway that connects to more than one network.

A separate protocol (the current standard is BGP-4, the Border Gateway


Protocol) is used to pass network connectivity information between gateways

Route:

The sequence of computers that a packet travels through from source to

destination is known as its route


Port:

The port allows TCP to be used to communicate with many different


applications on a machine.

NITHYAKANI.P

UNIT-I

Page 5

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

FUNCTION OF TCP/IP
o Reliable data transmission
o Error detection using checksum
Limitations of IP:o
No guarantee of packet delivery (packets can be dropped)
o
Communication is one-way (source to destination)
IP ALONG WITH TCP:o Provides guarantee that packets delivered
o Provide two-way (full duplex) communication

(ii)

Hypertext Transport Protocol (HTTP)

NITHYAKANI.P

UNIT-I

Page 6

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

HTTP is a form of stateless communication protocol which gives a detailed specification


of how web client and server should communicate.

HTTP is based on the request-response communication model:

Client sends a request

Server sends a response

HTTP is a stateless protocol:

The protocol does not require the server to remember anything about the client
between requests.

HTTP

Normally implemented over a TCP connection (80 is standard port number for HTTP)

Typical browser-server interaction:

User enters Web address in browser.

Browser uses DNS to locate IP address.

Browser opens TCP connection to server.

Browser sends HTTP request over connection.

Server sends HTTP response to browser over connection.

Browser displays body of response in the client area of the browser window.

The information transmitted using HTTP is often entirely text.

Can use the Internets Telnet protocol to simulate browser request and view server response.

NITHYAKANI.P

UNIT-I

Page 7

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


2.

Give the structure of HTTP request and response messages. (AM 2012), (MJ 2013) (ND
2012),(ND 2012),(ND2011), (AM 2011)
(i) HTTP REQUEST MESSAGE:1. Overall Structure
Every HTTP request message has the same basic structure:
Start line
Header field(s) (one or more)
Blank line
Message body (optional)
2. HTTP Version

The initial version of HTTP was referred to as HTTP/0.9.


All operational browsers and servers support HTTP/1.1 (latest version)

3. Request-URI
The Request-URI is a Uniform Resource Identifier and identifies the resource upon which
to apply the request.
TYPES of URI:-

Uniform resource locator(URL)

NITHYAKANI.P

Consists of a scheme, a host, and path name .

https://mail.google.com/mail/u/0/?shva=1#inbox/141707ce154b142f

UNIT-I

Page 8

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Uniform Resource Name(URN)


-

consists of unique identifier name

141707ce154b142f is the identifier of this email (URN).

4. Request Method

5. Header Fields and MIME Types

Each header field begins with a field name, such as Host, followed by a colon and then
a field value.

White space is allowed to precede or follow the field


Value
Some Header Fields are
Accept- request header defining MIME (Multipurpose Internet Mail
extensions)
User Agent request header specifying the type of client
From
If-Modified-Since

MIME TYPES
MIME TYPE
Text/plain

DESCRIPTION
Human readable text without formatting

Text/html
Image/jpeg

information
HTML document
JPEG encoded image

NITHYAKANI.P

UNIT-I

Page 9

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

(ii) HTTP RESPONSE MESSAGE


1. Overall Structure
Every HTTP response message has the same basic structure:
Status line
Header field(s) (one or more)
Blank line
Message body (optional)
2. Response Status Line
The first line of a Response message is the Status-Line, consisting of the protocol version
followed by a numeric status code.
The five classes of HTTP 1.1 status codes.
Digit
1
2
3
4
5

Class
International
Success
Redirection
Client Error
Server Error

3. Response Header Fields


Field Name

Response header fields give information about the server.


Use

Date

Time at which response was generated

Server

Information identifying the server software

Last-Modified

Time at which the resource was last modified.

Expires

Time after which the client should check with the

ETag

A hash code of the resource returned.

Accept-Ranges

specifies the units that may be used by the client in a range request.

Location

specify new URI for the requested resource.

4. Cache Control

A cache is a local copy of information obtained from some other source

NITHYAKANI.P

UNIT-I

Page 10

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Most web browsers use cache to store requested resources so that subsequent requests to the
same resource will not necessarily require an HTTP request/response

Ex: icon appearing multiple times in a Web page

Character Sets

A character set defines the mapping between these integers, or code points, and characters.

A character encoding is a bit string that must be decoded into a code-point integer that is
then mapped to a character according to the definition provided by some character set.

The Accept-Charset header field


used by a client to tell a server the character sets and character encodings

Content-Type header field - used in an HTTP response would indicate that the body of the
message is an HTML document.

3. Explain the capabilities of web client and web server. (12) (MJ 2013), (AM 2012)
WEB SERVER :-

NITHYAKANI.P

UNIT-I

Page 11

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


A Web server is a program that, using the client/server model and the World Wide Web's
Hypertext Transfer Protocol ( HTTP ), serves the files that form Web pages to Web users
(whose computers contain HTTP clients that forward their requests).

Every computer on the Internet that contains a Web site must have a Web server program.
Two leading Web servers:

Apache , the most widely-installed Web server.


Microsoft's Internet Information Server ( IIS ).

Characteristics of a server:

It is initially passive (or slave, waiting for a query);

It is listening, ready to respond to requests sent by clients;

When a request comes, he treats it and sends a response.

Basic functionality:
o

Receive HTTP request via TCP.

Map Host header to specific virtual host (one of many host names sharing an IP
address).

Map Request-URI to specific resource associated with the virtual host

NITHYAKANI.P

File: Return file in HTTP response.

Program: Run program and return output in HTTP response.

UNIT-I

Page 12

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


o

Map type of resource to appropriate MIME type and use to set Content-Type header
in HTTP response.

Log information about the request and response.

A web server log is a log file automatically created and maintained by a server
consisting of a list of activities it performed.
List of Contents:

Client IP address
Request date/time

Page requested

HTTP code

Bytes served

User agent

o Secure server: The standard means of indicating to a browser that it should encrypt
an HTTP request is to use the https scheme on the URL for the request.
o For e.g. https://www.example.org will cause the browser to attempt to send an
encrypted HTTP GET request.

WEB CLIENT:A Web Client is a program(web browser) that, using the client/server model and the
World Wide Webs Hypertext Transfer Protocol (HTTP), requests the web pages from the web
server.

Primary tasks:

Convert web addresses (URLs) to HTTP requests

Communicate with web servers via HTTP

Render (appropriately display) documents returned by a server

NITHYAKANI.P

UNIT-I

Page 13

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


FQDN- Fully Qualified Domain Name is the website address i.e., www.google.com...

Browser uses authority to connect via TCP

Request-URI included in start line (/ used for path if none supplied)

Fragment identifier not sent to server (used to scroll browser client area)

Standard features

4.

Save web page to disk

Find string in page

Fill forms automatically (passwords, CC numbers, )

Set preferences (language, character set, cache and HTTP parameters)

Modify display style (e.g., increase font sizes)

Display raw HTML and HTTP header info (e.g., Last-Modified)

Choose browser themes (skins)

View history of web addresses visited

Bookmark favorite pages for easy return

Additional functionality:

Execution of scripts (e.g., drop-down menus)

Event handling (e.g., mouse clicks)

GUI for controls (e.g., buttons)

Secure communication with servers

Display of non-HTML documents (e.g., PDF) via plug-ins

Web Client Logs:Record client activities such as


o Server address
o Response date/time
o Page accessed
o HTTP code
o URI
o Bytes received

State the types of lists supported by HTML and explain them in detail. (AM 2011)
or
Explain the purpose and way of creating lists in HTML documents. (8) (ND2011)
HTML LIST
HTML offers three ways to specify the lists of information.
NITHYAKANI.P

UNIT-I

Page 14

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


All lists must contain one or more list elements.
Types of List
1. Unordered Lists,
2. Ordered Lists
3. Description Lists

HTML List Tags


Types of List
Unordered
Ordered

Starting Tag
<ul>
<ol>
<dl>
<dt>
<dd>
<li>

Definition or
Description

Ending Tag
</ul>
</ol>
</dl>
</dt>
</dd>
</li>

Description
Defines an unordered list
Defines an ordered list
Defines a description list
Defines the term in a description list
Defines the description in a description list
Defines a list item

Unordered HTML Lists

An unordered list starts with the <ul> tag and ends with </ul> tag.
Each list item starts with the <li> tag.

Unordered HTML Lists - The Style Attribute


A style attribute can be added to an unordered list, to define the style of the marker:
Style
<ul type="disc">
<ul type="circle">
<ul type="square">
Example:-

Description
The list items will be marked with bullets (default)
The list items will be marked with circles
The list items will be marked with squares

Symbol

The list items will be marked with bullets (small black circles).

HTML Script

Display in a Web Page

<!DOCTYPE html>
<html>
<body>
<h2>Unordered List with Default bullets </h2>
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
NITHYAKANI.P

Unordered List with Default Bullets

Apples
Bananas

UNIT-I

Page 15

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


<li>Oranges</li>
</ul>

Lemons

Oranges

</body>
</html>
Ordered HTML Lists

An ordered list starts with the <ol> tag and ends with </ol> tag.
Each list item starts with the <li> tag.

The list items will be marked with numbers.

A type attribute can be added to an ordered list, to define the type of the marker:
Type
type="1"
type="A"
type="a"
type="I"
type="i"

Description
The list items will be numbered with numbers (default)
The list items will be numbered with uppercase letters
The list items will be numbered with lowercase letters
The list items will be numbered with uppercase roman numbers
The list items will be numbered with lowercase roman numbers

Symbol
1. 2. 3.
A. B. C.
a. b. c.
I. II. III.
i. ii. iii.

Example for Ordered List


HTML Script
<!DOCTYPE html>
<html>
<body>
<h2>Ordered List</h2>
<ol>
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
</body>
</html>

Display in a Web Page

Ordered List
1. Apples
2. Bananas
3. Lemons
4. Oranges

HTML Description Lists

A description list is a list of terms, with a description of each term.


The <dl> tag defines a description list and ends with </dl>

The <dt> tag defines the term (name), and the <dd> tag defines the data (description).

HTML Script
<!DOCTYPE html>
<html>
NITHYAKANI.P

Display in a Web Page

UNIT-I

Page 16

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

5.

<body>
<h2>A Description List</h2>
A Description List
<dl>
<dt>Coffee</dt>
Coffee
<dd> - black hot drink
- black hot drink
</dd>
Milk
<dt>Milk</dt>
- white cold drink
<dd> - white cold drink <dd>
</dl>
</body> </html>
Explain how tables can be inserted into a HTML document with an example.
TABLES:The HTML tables allow users to arrange data into rows and columns of cells.
The HTML tables are created using the <table> tag in which the <tr> tag is used to create table
rows and <td> tag is used to create data cells.
Table elements

Starting Tag

Ending Tag

Description

table

<table>

</table>

defines a table

caption

<caption>

</caption>

gives the table caption

tr

<tr>

</tr>

defines a row in a table

th

<th>

</th>

defines a header cell

Td

<td>

</td>

defines the data in the table cell

HTML Script File name: eligibility.html

Display in a Web Page

!DOCTYPE HTML>
<html>
<head>
<title>Campus Recruitment Program 2014-2015 </title>
</head>
<body>
<table border="1">
<caption><h3><b> Eligibility criteria for Students <b> </h3>
</caption>
<tr> <th> Degree </th>
<th>Percentage / CGPA</th>
</tr>
<tr> <td>X</td>
<td>60%</td>
</tr>
NITHYAKANI.P

UNIT-I

Page 17

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


<tr><td>XII</td>
<td>60%</td>
</tr>
<tr> <td>B.TECH</td>
<td>68% / 6</td>
</tr>
<tr> <td>M.TECH</td>
<td>68% / 6</td>
</tr>
</table> </body> </html>

Table Attributes:
Table Attributes

Format

Eg.

Border

border=value

border=1

Cell padding (space btw cell and the wall)

cellpadding=value

cellpadding=2

Cell spacing (space btw cells)

cellspacing=value

cellspacing=2

Row span (merge the rows)

rowspan=value

rowspan=3

Col span (merge the cols)

colspan=value

colspan=3

FORMS:

A form will take input from the user and then will post it to a back-end application such as CGI,

ASP Script or PHP script etc.


The back-end application will perform required processing on the passed data based on defined
business logic inside the application.
E.g.: online banking, online purchasing, online registration etc.
Form

elements
Form
Input
Select
Option

NITHYAKANI.P

Starting Tag
<form>
< input >
<select>
<option>

Ending Tag
</form>
</select>
</option>

Description
defines the form
Get the input from the user
Defines the drop down list
Defines the option to select

UNIT-I

Page 18

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

INPUT TAG

Type

Description

ATTRIBUTES
Text

type=text

Defines normal text input

Radio

type=radio"

Defines radio button input (for selecting one of many choices)

Submit

type=submit

Defines a submit button (for submitting the form)

Password

type=password Defines password. Masks the character as user enters

Checkbox

type=checkbox Defines a checkbox button(for selecting one of many option)

Html Script : Filename- reg form.html

Display in a web page

<!DOCTYPE HTML>
<html>
<head><title>REG FORM</title></head>
<body>
<h4>Student Info</h4>
<FORM>
Student Name:<input type="text"
width="20"><br>
Batch:<select>
<option type="" value="2012 to 2016">
2012 2016 </option>
<option type="" value="2011 to 2015">
2011 2015 </option>
</select><br>
<br>
<br>
CGPA:<select>
<option type="" value="10"> 10 </option>
<option type="" value="9"> 9 </option>
<option type="" value="8"> 8 </option>
<option type="" value="7"> 7 </option>
<option type="" value="6"> 6 </option>
</select>
</form></body>
</html>

NITHYAKANI.P

UNIT-I

Page 19

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

6.

Explain the use of relative URLs with an example.


o A relative URL doesnt contain any protocol or machine information.
o Its path generally refers to a resource on the same machine as the current document.
o Relative URLs may contain relative path components (".." means one level up in the
hierarchy defined by the path), and may contain fragment identifiers.
o Relative URLs are resolved to full URLs using a base URL.
As an example of relative URL resolution:

MAIN HTML PATH:


file:///C:/Users/SYS1/Desktop/Interview.html

The relative URL in the following markup for a hypertext link:


<img src="git.png"> expands to the image contained in the URL git.png
<a href="eligibility.html">Eligibility Criteria</a> expands to the html file contained
in the URL eligibility.html

Html Script File name: interview.html

NITHYAKANI.P

Display in a Web Page

UNIT-I

Page 20

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


<!DOCTYPE html>
<html>
<head><title>GIT INTERVIEW</title>
</head>
<body>
<img src="git.png">
<H4><b><u>Links Regarding Campus Interview
<u></b></h4>
<ul>
<li>
<a href="eligibility.html">Eligibility Criteria
</a></li>
<li><a href="reg form.html">Registration
Form</a> </li>
</ul>
</body>
</html>

7.

How do you create frames? Why do we need them? Develop an application to explain the same.
FRAMES

Frames is used to display more than one HTML document in the same browser window.
Each HTML document is called a frame, and each frame is independent of the others.
Elements of Frames:
1. The Frameset Tag

The <frameset> tag defines how to divide the window into frames.
Each frameset defines a set of rows or columns.
The values of the rows/columns indicate the amount of screen area each

row/column will occupy.


Format:
<frameset cols=25%,25%,50%>
2. The Frame Tag
The <frame> tag defines what HTML document to put into each frame.
Html Script File name: Frames.html

NITHYAKANI.P

Display in a Web Page

UNIT-I

Page 21

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


<!DOCTYPE html>
<html>
<frameset rows="50%,50%">
<frame src="Eligibility.html">
<frame src="reg form.html">
</frameset>
</html>

Html Script for Frame Sources:<frame src="Eligibility.html">

NITHYAKANI.P

<frame src="reg form.html">

UNIT-I

Page 22

GIT-DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


!DOCTYPE HTML>
<html>
<!DOCTYPE HTML>
<head>
<html>
<title>Campus Recruitment Program 2014-2015 <head>
</title>
<title>REG FORM</title></head>
</head>
<body>
<body>
<h4>Student Info</h4>
<table border="1">
<FORM>
<caption>
Student Name:<input type="text" width="20">
<h3><b> Eligibility criteria for Students <b> </h3> <br>
</caption>
Batch:<select>
<tr> <th> Degree </th>
<option type="" value="2012 to 2016">
<th>Percentage / CGPA</th>
2012 2016 </option>
</tr>
<option type="" value="2011 to 2015">
<tr> <td>X</td>
2011 2015 </option>
<td>60%</td>
</select><br>
</tr>
<br>
<tr><td>XII</td>
<br>
<td>60%</td>
CGPA:<select>
</tr>
<option type="" value="10"> 10 </option>
<tr> <td>B.TECH</td>
<option type="" value="9"> 9 </option>
<td>68% / 6</td>
<option type="" value="8"> 8 </option>
</tr>
<option type="" value="7"> 7 </option>
<tr> <td>M.TECH</td>
<option type="" value="6"> 6 </option>
<td>68% / 6</td>
</select>
</tr>
</form></body>
</table> </body> </html>
</html>

The disadvantages of using frames are:

NITHYAKANI.P

The web developer must keep track of more HTML documents.


It is difficult to print the entire page.

UNIT-I

Page 23

Potrebbero piacerti anche