Sei sulla pagina 1di 14

Semester: 3 (Spring-2016 Assignment)

Subject: MIT302 WEB TECHNOLOGIES


BK ID: B1547
Roll No: 1545001399
Name: Tushar Seth
Max. Marks 60

#1. Describe the following protocols: a) IP b) HTTP c) FTP


d) SMTP
ANSWER
(a) IP
An Internet Protocol address (IP address) is a numerical label assigned to
each device (e.g., computer, printer) participating in a computer network
that uses the Internet Protocol for communication. An IP address serves two
principal functions: host or network interface identification and location
addressing. Its role has been characterized as follows: "A name indicates
what we seek. An address indicates where it is. A route indicates how to get
there.
Internet is a global network of computers each computer connected to the
Internet must have a unique address. Internet addresses are in the form
xxx.xxx.xxx.xxx where xxx must be a number from 0 - 255. This address is
known as an IP (Internet Protocol) address. Below figure shows the Internet
address.

Figure: Internet Address


The above figure shows two computers connected to the Internet; your
computer with IP address 1.2.3.4 and another computer with IP address
5.6.7.8. The Internet is represented as an abstract object in-between.
b) HTML:
HyperText Markup Language, commonly abbreviated as HTML, is the
standard markup language used to create web pages. Along with CSS, and
JavaScript, HTML is a cornerstone technology used to create web pages, as
well as to create user interfaces for mobile and web applications. Web
browsers can read HTML files and render them into visible or audible web
pages. HTML describes the structure of a website semantically and, before
the advent of Cascading Style Sheets (CSS), included cues for the
presentation or appearance of the document (web page), making it a markup
language, rather than a programming language.
1

HTML elements form the building blocks of HTML pages. HTML allows images
and other objects to be embedded and it can be used to create interactive
forms. It provides a means to create structured documents by denoting
structural semantics for text such as headings, paragraphs, lists, links,
quotes and other items. HTML elements are delineated by tags, written using
angle brackets. Tags such as <img /> and <input /> introduce content into
the page directly. Others such as <p>...</p> surround and provide
information about document text and may include other tags as subelements. Browsers do not display the HTML tags, but use them to interpret
the content of the page.
HTML can embed scripts written in languages such as JavaScript which affect
the behavior of HTML web pages. HTML markup can also refer the browser to
Cascading Style Sheets (CSS) to define the look and layout of text and other
material. The World Wide Web Consortium (W3C), maintainer of both the
HTML and the CSS standards, has encouraged the use of CSS over explicit
presentational HTML since 1997.

c) FTP (File Transfer Protocol)


FTP is built on a client-server model architecture and uses separate control
and data connections between the client and the server. FTP users may
authenticate themselves with 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). SSH File Transfer Protocol (SFTP) is sometimes also used
instead, but is technologically different.
2

FTP is probably the most used resource on the Internet. It is a protocol which
allows users on computer to transfer files to another computer or we can say
to exchange files over the Internet. FTP works in the same way as HTTP
(Hypertext Transfer Protocol) for transferring Web pages from a server to a
user's browser and SMTP for transferring electronic mail across the Internet
in that, like these technologies, FTP uses the Internet's TCP/IP protocols to
enable data transfer.
When you take a file from a remote machine down to your own machine, it is
called a download. When the opposite happens and you place a file on a
remote machine, it is called an upload. FTP is most commonly used to
download a file from a server using the Internet or to upload a file to a
server.
d) SMTP (Simple Mail Transfer Protocol)
Simple Mail Transfer Protocol (SMTP) is an Internet standard for electronic
mail (email) transmission. First defined by RFC 821 in 1982, it was last
updated in 2008 with the Extended SMTP additions by RFC 5321which is
the protocol in widespread use today. SMTP by default uses TCP port 25. The
protocol for mail submission is the same, but uses port 587. SMTP
connections secured by SSL, known as SMTPS, default to port 465
(nonstandard, but sometimes used for legacy reasons). Although electronic
mail servers and other mail transfer agents use SMTP to send and receive
mail messages, user-level client mail applications typically use SMTP only for
sending messages to a mail server for relaying. For retrieving messages,
client applications usually use either POP3 or IMAP.

Although proprietary systems (such as Microsoft Exchange and IBM Notes)


and webmail systems (such as Outlook.com, Gmail and Yahoo! Mail) use their
own non-standard protocols to access mail box accounts on their own mail
servers, all use SMTP when sending or receiving email from outside their own
systems.
SMTP is used for sending E-mail messages between servers. Most e-mail
systems that send mail over the internet use SMTP to send messages from
one server to another, the messages can then be retrieved with an e-mail
client. In addition, SMTP is generally used to send messages from a mail
client to mail server.

#2. Differentiate HTML and DHTML. Describe any four


Advantages of DHTML
ANSWER Differentiate HTML and DHTML
Dynamic HTML is an extension of HTML that enables, among other things,
the inclusion of small animations and dynamic menus in Web pages. DHTML
code makes use of style sheets and JavaScript.
When you see an object, or word(s), on a webpage that becomes highlighted,
larger, a different color, or a streak runs through it by moving your mouse
cursor over it is the result of adding a DHTML effect. This is done in the
language coding and when the file of the webpage was saved it was saved
as the .dhtml format instead of .htm or .html.

DHTML sites are dynamic in nature. DHTML uses client side scripting to
change variables in the presentation which affects the look and function of
an otherwise static page. DHTML characteristics are the functions while a
page is viewed, rather than generating a unique page with each page load (a
dynamic website).
On the other hand, HTML is static. HTML sites rely solely upon client-side
technologies. This means the pages of the site do not require any special
processing from the server side before they go to the browser. In other
words, the pages are always the same for all visitors - static. HTML pages
have no dynamic content.
Advantages of DHTML
1. Supported by all browsers: DHTML is supported in every major
browser, including Opera, Safari, Internet Explorer, and Firefox.
2. Open standards: You can create your pages according to the
standardized technologies of DHTML and you can expect that, they will
display much the same on any major browser.
3. Small file sizes: Like HTML, we create DHTML with files, which are
smaller than graphic files and generally render faster than alternatives such
as flash and java.
4. Change contents on the fly: When we have loaded our DHTML page
then also we can make the necessary changes to the web page without
having to reload it. This is where the dynamic in DHTML comes from.

#3. List and explain the Components of XML processor


ANSWER
5

Components of XML processor


a) Parser
Every XML processor has a parser. An XML parser converts an XML document
into an XML DOM object - which can then be manipulated with a JavaScript.
The parser's job is to translate XML markup and data into a stream of bitesized nuggets, called tokens, to be used for processing. A token may be an
element start tag, a string of character content, the beginning delimiter of a
processing instruction, or some other piece of markup that indicates a
change between regions of the document.
In the following figure, we have conversed about XML parsing process
operates in three phases:

Figure: Three Stages of XML Parsing Process


Stage 1: In this stage, the application parses and validates the source
document; recognizes and searches for relevant information based on its
location or its tagging in the source document; extracts the relevant
information when it is located; and, optionally, maps and binds the retrieved
information to business objects.
Stage 2: Business logic handling. This is the stage in which the actual
processing of the input information takes place. It might result in the
generation of output information.
Stage 3: XML output processing. In this stage, the application constructs a
model of the document to be generated with the Document Object Model
(DOM). It then either applies XSLT style sheets or directly serializes to XML.
b) Event switcher
The event switcher receives a stream of tokens from the parser and sorts
them according to function, like a switchboard telephone operator of old.
Some tokens signal that a change in behavior is necessary. These are called
events. One event may be that a processing instruction with a target
keyword significant to the XML processor has been found. Another may be
that a <title> element has been seen, signaling the need for a font change.

What the events are and how they are handled are up to the particular
processor.
c) Tree representation
The tree representation can take many forms, but there are two main types.
i) The first is a simple structure consisting of a hierarchy of node lists. This
is the kind of structure you would find in a non-object- oriented approach.
ii) The other kind is called an object model, where every node is
represented as an object. In a programming phrase, an object is a package of
data and routines in a rigid, cloudy framework. This style is preferred for
large programs, because it minimizes certain types of bugs and is usually
easier to visualize. Object trees are expensive in terms of speed and
memory, but for many applications this is an acceptable trade-off for
convenience of development.

Tree representation of Book

d) Tree processor
The tree processor is the part of the program that operates on the tree
model. It can be anything from a validity checker to a full-blown
transformation engine. It traverses the tree, usually in a methodical, depthfirst order in which it goes to the end of a branch and backtracks to find the
last unchecked node. Often, its actions are controlled by a list of rules, where
7

a rule is some description of how to handle a piece of the tree. For example,
the tree processor may use the rules from a stylesheet to translate XML
markup into formatted text.

#4. Describe the procedure of fetching data from XML to HTML


example.
ANSWER
The important issues involved in the design and implementation of DSM
systems are as follows:
1. Granularity: It refers to the block size of the DSM system, i.e. to the
units of sharing and the unit of data transfer across the network when
a network block fault occurs. Possible units are a few words, a page, or
a few pages.
2. Structure of Shared Memory Space: The structure refers to the Lay
out of the shared data in memory. It is dependent on the type of
applications that the DSM system is intended to support.
3. Memory coherence and access synchronization: Coherence
(consistency) refers to memory coherence problem that deals with the
consistency of shared data that lies in the main memory of two or
more nodes. Synchronization refers to synchronization of concurrent
access to shared data using synchronization primitives such as
semaphores.
4. Data Location and Access: A DSM system must implement
mechanisms to locate data blocks in order to service the network data
8

block faults to meet the requirements of the memory coherence


semantics being used.
5. Block Replacement Policy: If the local memory of a node is full, a
cache miss at that node implies not only a fetch of the accessed data
block from a remote node but also a replacement i.e. a data block of
the local memory must be replaced by the new data block. Therefore a
block replacement policy is also necessary in the design of a DSM
system.
6. Thrashing: In a DSM system, data blocks migrate between nodes on
demand. If two nodes compete for write access to a single data item,
the corresponding data block may be transferred back and forth at
such a high rate that no real work can get done. A DSM system must
use a policy to avoid this situation (known as Thrashing).
7. Heterogeneity: The DSM systems built in for homogenous systems
need not address the heterogeneity issue. However, if the underlying
system environment is heterogeneous, the DSM system must be
designed to take care of heterogeneity so that it functions properly
with machines having different architectures.

#5. Describe five different categories of PHP Operators.


ANSWER
PHP Operators
In all programming languages, operators are used to manipulate or perform
operations on variables and values. There are many operators used in PHP,
so we have separated them into the following categories to make it easier to
learn them all.
1. Assignment Operators
2. Arithmetic Operators
3. Comparison Operators
4. String Operators
5. The Concatenation Operator
9

Assignment operators are used to set a variable equal to a value or set a


variable to another variable's value. Such an assignment of value is done
with the "=", or equal character. Example:
$my_data = 2;
$another_data = $my_data
Now both $my_data and $another_data contain the value 2. Assignments
can also be used in conjunction with arithmetic operators.
Arithmetic operators are used to perform mathematical operations like
addition, subtraction, multiplication, division and Modulus. Table 11.1 shows
all the arithmetic operators.
Table: Arithmetic Operator

Comparison operators Comparisons are used to check the relationship


between variables and/or values. Comparison operators are used inside
conditional statements and evaluate to either true or false. Here are the
most important comparison operators of PHP. Assume: $x = 4 and $y = 5;
Table 11.2 shows all the comparison operators.
Table: Comparison Operator

String Operators As we have already seen in the Echo statement, the


period "." is used to add two strings together, or more technically, the period
10

is the concatenation operator for strings. By the following program you can
see the function of string operator.

The Concatenation Operator


There is only one string operator in PHP. The concatenation operator (.) is
used to put two string values together. To concatenate two string variables
together, use the concatenation operator:
<?php $txt1="Hello World!";
$txt2="Distance education!";
echo $txt1 . " " . $txt2; ?>

The output of the code above will be:


Hello World! Distance education!

#6.
ASP.

Describe

ANSWER
Introduction of ASP
Active Server Pages (ASPs) are Web pages that contain server-side
scripts in addition to the usual mixture of text and HTML (Hypertext Markup
Language) tags. Server-side scripts are special code that is put in Web Pages
and that code is processed before it is sent to the Web browser of someone
who's visiting your Web site. When we type a URL in the Addressbox or click
a link on a Web page it means we are asking a Web server to send a file to
11

the Web browser on our computer. If that file is a normal HTML file, it looks
exactly the same when your Web browser receives it as it did before the Web
server sent it. After receiving the file, your Web browser displays its contents
as a combination of text, images, and sounds.
How ASP Works?
Following are some steps that will help us to know about ASP working:
1. The user brings up a Web site where the default page has the extension
.asp.
2. The browser requests the ASP file from the Web server.
3. The server-side script begins to run with ASP.
4. ASP processes the requested file sequentially (top-down), executes any
script commands contained in the file, and produces an HTML Web page.
5. The Web page is sent to the browser.
Because our script runs on the server, the Web server does all of the
processing and standard HTML pages can be generated and sent to the
browser. This means that our Web pages are limited only by what our Web
server supports. Another benefit of having our script reside on the server is
that the user cannot "view source" on the original script and code. Instead,
the user sees only the generated HTML as well as non-HTML content, such as
XML, on the pages that are being viewed. Following figure 13.1 shows the
working of ASP page.

Figure: Working of ASP Pages


Server-side scripts look a lot like HTML tags. However, instead of starting and
ending with lesser-than (<) and greater-than (>) brackets, they typically start
with <% and end with %>. The <% is called an opening tag, and the %> is
called a closing tag. In between these tags are the server-side scripts. You
12

can insert server-side scripts anywhere in your Web page--even inside HTML
tags.

13

Potrebbero piacerti anche