Вы находитесь на странице: 1из 12

Computer Science and Engineering,

V-Semester Open Elective CS- 504 (A)


Internet and Web Technology
Assignment Solutions
UNIT-1
Q1: Explain Architecture of WWW in details.
Ans. WWW architecture is divided into several layers as shown in the following diagram:

Identifiers and Character Set :-


Uniform Resource Identifier (URI) is used to uniquely identify resources on the web and UNICODE makes
it possible to built web pages that can be read and write in human languages.
Syntax:-
XML (Extensible Markup Language) helps to define common syntax in semantic web.
Data Interchange:-
Resource Description Framework (RDF) framework helps in defining core representation of data for web.
RDF represents data about resource in graph form.
Taxonomies:-
RDF Schema (RDFS) allows more standardized description of taxonomies and other ontological constructs.
Ontologies:-
Web Ontology Language (OWL) offers more constructs over RDFS. It comes in following three versions:
 OWL Lite for taxonomies and simple constraints.
 OWL DL for full description logic support.
 OWL for more syntactic freedom of RDF
Rules :-
RIF and SWRL offers rules beyond the constructs that are available from RDFs and OWL. Simple Protocol
and RDF Query Language (SPARQL) is SQL like language used for querying RDF data and OWL
Ontologies.
Proof:-
All semantic and rules that are executed at layers below Proof and their result will be used to prove
deductions.
Cryptography:-
Cryptography means such as digital signature for verification of the origin of sources is used.
Q2: What is HTTPS? How does it work? Give appropriate example.
Ans. HTTPS stands for Hyper Text Transfer Protocol Secure. It is a protocol for securing the communication
between two systems. e.g. the browser and the web server Hypertext transfer protocol secure (HTTPS) is the
secure version of HTTP, which is the primary protocol used to send data between a web browser and a
website. HTTPS is encrypted in order to increase security of data transfer. This is particularly important
when users transmit sensitive data, such as by logging into a bank account, email service, or health insurance
provider.
HTTPS uses an encryption protocol to encrypt communications. The protocol is called Transport Layer
Security (TLS), although formerly it was known as Secure Sockets Layer (SSL). This protocol secures
communications by using what’s known as an asymmetric public key infrastructure. This type of security
system uses two different keys to encrypt communications between two parties:
The private key - this key is controlled by the owner of a website and it’s kept, as the reader may have
speculated, private. This key lives on a web server and is used to decrypt information encrypted by the
public key. The public key - this key is available to everyone who wants to interact with the server in a way
that’s secure. Information that’s encrypted by the public key can only be decrypted by the private key.
Q3: Explain how Request – Response mechanism works over internet?
Ans. HTTP and all extended protocols based on HTTP are based on a very simple communications model.
Here’s how it works: a client, typically a web browser, sends a request for a resource to a server, and the
server sends back a response corresponding to the resource (or a response with an error message if it can’t
process the request for some reason). A resource can be a number of things, such as a simple HTML file
returned verbatim to the browser or a program that generates the response dynamically. This
request/response model is illustrated in Figure.

Figure - HTTP request/response with two resources

Q4: Why HTTPS is called state less protocol?


Ans - HTTP is a stateless protocol. A stateless protocol does not require the server to retain information or
status about each user for the duration of multiple requests. But some web applications may have to track the
user's progress from page to page, for example when a web server is required to customize the content of a
web page for a user. Solutions for these cases include:

1. The use of HTTP cookies.


2. Server side sessions,
3. Hidden variables (when the current page contains a form), and
4. URL-rewriting using URI-encoded parameters.

Q5: Write a short note on Architecture of Web Server.


Ans. Web server responds to the client request in either of the following two ways:
1. Sending the file to the client associated with the requested URL.
2. Generating response by invoking a script and communicating with database

Key Points
1. When client sends request for a web page, the web server search for the requested page if requested
page is found then it will send it to client with an HTTP response.
2. If the requested web page is not found, web servers will the send an HTTP response: Error 404 not
found.
3. If client has requested for some other resources then the web server will contact to the application
server and data store to construct the HTTP response
Web Server Architecture follows the following two approaches:
1. Concurrent Approach.
2. Single-Process-Event-Driven Approach.
Concurrent Approach:-
Concurrent approach allows the web server to handle multiple client requests at the same time. It can be
achieved by following methods:
Multi-processing:-
In this a single process (parent process) initiates several single-threaded child processes and distribute
incoming requests to these child processes. Each of the child processes are responsible for handling single
request. It is the responsibility of parent process to monitor the load and decide if processes should be killed
or forked.
Multi-threaded:-
Unlike Multi-process, it creates multiple single-threaded processes.
Hybrid:-
It is combination of above two approaches. In this approach multiple process are created and each process
initiates multiple threads. Each of the threads handles one connection. Using multiple threads in single
process results in less load on system resources.
UNIT-2
Q1: Write the Format of HTML program. (Mark-4)
Ans: HTML is the standard mark-up language for creating Web pages.
 HTML stands for Hyper Text Mark-up Language
 HTML describes the structure of a Web page
 HTML consists of a series of elements
 HTML elements tell the browser how to display the content
 HTML elements are represented by tags
 HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
 Browsers do not display the HTML tags, but use them to render the content of the page

A Simple HTML Format


Example:
<! DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>

Q2: Explain about List tag. (Mark-4)


Ans: List Tag
HTML offers three ways for specifying lists of information. All lists must contain one or more list elements.
The types of lists that can be used in HTML are:
ul : An unordered list. This will list items using plain bullets.
ol : An ordered list. This will use different schemes of numbers to list your items.
dl : A definition list. This arranges your items in the same way as they are arranged in a dictionary.

The Unordered HTML List- An unordered list starts with the “ul” tag. Each list item starts with the “li”
tag. The list items are marked with bullets i.e small black circles by default.
Example:

<!DOCTYPE html>
<html>
<body>
<h2>Grocery list</h2>
<ul>
<li>Bread</li>
<li>Eggs</li>
<li>Milk</li>
<li>Coffee</li>
</ul>
</body>
</html>
Output:

Q3: Mention the different types of Links. (Mark-4)


Ans: HTML Links, Links are found in nearly all web pages. Links allow users to click their way from page
to page.
HTML Links – Hyperlinks
HTML links are hyperlinks. You can click on a link and jump to another document. When you move the
mouse over a link, the mouse arrow will turn into a little hand.

Note: A link does not have to be text. It can be an image or any other HTML element.
HTML Links - Syntax
Hyperlinks are defined with the HTML <a> tag:
<a href="url">link text</a>
Example
<a href="https://www.w3schools.com/html/">Visit our HTML tutorial</a>
Local Links
A local link (link to the same web site) is specified with a relative URL (without https://www....).
Example
<a href="html_images.asp">HTML Images</a>
Q4: what is the uses of Frames in html. Give the syntax of frames. (Mark-4)
Ans: Definition and Usage
The <frameset> tag is not supported in HTML5.
The <frameset> tag defines a frameset.
The <frameset> element holds one or more <frame> elements. Each <frame> element can hold a separate
document.
The <frameset> element specifies HOW MANY columns or rows there will be in the frameset, and HOW
MUCH percentage/pixels of space will occupy each of them.
Note: If you want to validate a page containing frames, be sure the <! DOCTYPE> is set to either "HTML
Frameset DTD" or "XHTML Frameset DTD".
Browser Support

Element Chrome Internet Explorer Firefox OperaMini

<frameset> Yes Yes Yes Yes


Example A simple three-framed page:
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
Q5: What is the html to create the following orderlist. (Mark-4)
Ans: Following code to create an ordered list using the <ol> tag:
<! DOCTYPE html>
<html>
<head>
<title>HTML ol Tag</title>
</head>
<body>
<p>Programming Languages:</p>
<ol>
<li>Java</li>
<li>C++</li>
<li>C</li>
</ol>
</body>
</html>

UNIT -3
Q1: What are style sheet?

Ans- A style sheet is a file or form that is used in word processing and desktop publishing to define the
layout style of a document. A style sheet contains the specifications of a document's layout, such as the page
size, margins, fonts and font sizes. In modern word processors such as Microsoft Word, a style sheet is
known as a template. The most well-known form of style sheet is the Cascading Style Sheet (CSS), which is
used for styling Web pages.
The font tag deprecated and it is supposed to be removed in a future version of HTML. So they should not
be used rather, it's suggested to use CSS styles to manipulate your fonts. But still for learning purpose, this
chapter will work with an example using the font tag.
Example-
Live Demo
<! DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>
</head>
<body>
<pstyle="color: green; font-size: 24px ;"> Hello, World! </p>
</body>
</html>

Q 2: List down the ways of including style information in a document.

Ans- HTML is quite limited when it comes to the presentation of a web page. It was originally designed as
a simple way of presenting information.

With CSS, it becomes very easy to specify the things like, size and typeface for the fonts, colors for the text
and backgrounds, alignment of the text and images, amount of space between the elements, border and
outlines for the elements, and lots of other styling properties.

Style information can either be attached as a separate document or embedded in the HTML document itself.
These are the three methods of implementing styling information to an HTML document.
Inline styles — Using the style attribute in the HTML start tag.
Embedded style — using the <style> element in the head section of the document.
External style sheet — Using the <link> element, pointing to an external CSS files.

Q3: Client side scripting?


Ans- CSS stands for Cascading Style Sheets

1. CSS describes how HTML elements are to be displayed on screen, paper, or in other media
2. CSS saves a lot of work. It can control the layout of multiple web pages all at once
3. External style sheets are stored in CSS files

CSS Solved a Big Problem


1. HTML was NEVER intended to contain tags for formatting a web page!
2. HTML was created to describe the content of a web page, like:
3. <h1>This is a heading</h1>
4. <p>This is a paragraph.</p>
5. When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a
nightmare for web developers. Development of large websites, where fonts and color information
were added to every single page, became a long and expensive process.
6. To solve this problem, the World Wide Web Consortium (W3C) created CSS.
7. CSS removed the style formatting from the HTML page!

Q4: List the advantages of Java Script.


Ans-Simplicity. JavaScript is relatively simple to learn and implement.

Popularity- JavaScript is used everywhere in the web. The resources to learn JavaScript are numerous.
Stack Overflow and GitHub have many projects that are using JavaScript and the language as a whole has
gained a lot of traction in the industry in recent years especially.
Interoperability- JavaScript plays nicely with other languages and can be used in a huge variety of
applications. Unlike PHP or SSI scripts, JavaScript can be inserted into any web page regardless of the file
extension. JavaScript can also be used inside scripts written in other languages such as Perl and PHP.
Server Load-Being client-side reduces the demand on the website server.
Rich interfaces- Drag and drop components or slider may give a rich interface to your website.
Extended Functionality- Third party add-ons like Grease monkey enable JavaScript developers to write
snippets of JavaScript which can execute on desired web pages to extend its functionality.
Versatility- Nowadays, there are many ways to use JavaScript through Node.js servers. If you were to
bootstrap node.js with express, use a document database like mongodb, and use JavaScript on the front-end
for clients, it is possible to develop an entire JavaScript app from front to back using only JavaScript.
Updates- Since the advent of EcmaScript 5 (the scripting specification that JavaScript relies on), Ecma
International has dedicated to updating JavaScript annually. So far, we have received browser support for
ES6 in 2017 and look forward to ES7 being supported in future months.

Q5: What is selector string? Specify any three forms of selector.


Ans-CSS selectors are used to select the content you want to style. Selectors are the part of CSS rule set.
CSS selectors select HTML elements according to its id, class, type, attribute etc.
There are several different forms of selectors in CSS.
1. CSS Element Selector
2. CSS Id Selector
3. CSS Class Selector
4. CSS Universal Selector
5. CSS Group Selector

UNIT-4
Q1: What is XML? How it is different from HTML?
Ans. XML stands for Extensible Mark-up Language. It is a text-based mark-up language derived from
Standard Generalized Mark-up Language (SGML).
XML tags identify the data and are used to store and organize the data, rather than specifying how to
display it like HTML tags, which are used to display the data. XML is not going to replace HTML in the
near future, but it introduces new possibilities by adopting many successful features of HTML.
XML and HTML were designed with different goals:
1. XML was designed to carry data - with focus on what data is.
2. HTML was designed to display data - with focus on how data looks.
3. XML tags are not predefined like HTML tags are.

Q2: What are the uses of XML?


Ans. XML has a variety of uses for Web, e-business, and portable applications. The following are some of
the many applications for which XML is useful:
1. Web publishing: XML allows you to create interactive pages, allows the customer to customize
those pages, and makes creating e-commerce applications more intuitive
2. Web searching and automating Web tasks: XML defines the type of information contained in a
document, making it easier to return useful results when searching the Web.
3. General applications: XML provides a standard method to access information, making it easier for
applications and devices of all kinds to use, store, transmit, and display data.
4. E-business applications: XML implementations make electronic data interchange (EDI) more
accessible for information interchange, business-to-business transactions, and business-to-consumer
transactions.
5. Metadata applications: XML makes it easier to express metadata in a portable, reusable format.
6. Pervasive computing: XML provides portable and structured information types for display on
pervasive computing devices such as personal digital assistants, cellular phones, and others. For
example, WML (Wireless Mark-up Language) and Voice XML are currently evolving standards for
describing visual and speech-driven wireless device interfaces.

Q3: What do you mean by DTD in XML?


Ans. DTD stands for Document Type Definition. It defines the legal building blocks of an XML document.
It is used to define document structure with a list of legal elements and attributes. Its main purpose is to define
the structure of an XML document. It contains a list of legal elements and defines the structure with the help of them.
Before proceeding with XML DTD, you must check the validation. An XML document is called "well-formed" if it
contains the correct syntax. A well-formed and valid XML document is one which has been validated against DTD.

Q4: Define XML?


Ans. Extensible Mark-up Language (XML) is a mark-up language that defines a set of rules for
encoding documents in a format that is both human-readable and machine-readable. The World Wide Web
Consortium's XML 1.0 Specification of 1998 and several other related specifications—all of them free open
standards—define XML.
The design goals of XML emphasize simplicity, generality, and usability across the Internet. It is a textual
data format with strong support via Unicode for different human languages. Although the design of XML
focuses on documents, the language is widely used for the representation of arbitrary data structures such as
those used in web services.
Several schema systems exist to aid in the definition of XML-based languages, while programmers have
developed many application programming interfaces (APIs) to aid the processing of XML data.

Q5. What are the different XSLT elements?


Ans. The xsl: element element is used to create and name an element (node) that can appear in the output.
This ability to create both custom elements and attributes, and to display the results, is a major reason why
style sheets generated by XSL are a very sophisticated approach to displaying XML data. There are two
ways to add attributes to a created element: by using the xsl: attribute, xsl: copy, and the xsl:copy-
of elements or, by using the optional use-attribute-sets attribute of the xsl:element element. Any attributes
created using the use-attribute-sets attribute that have the same name as attributes created using the xsl:
attribute, xsl:copy, and the xsl:copy-of elements, will be overwritten.
UNIT-5
Q1:In how many ways we can retrieve the data is the result set of MySQL using php?
Ans. In the following ways we can retrieve the data:
1. mysql_fetch_row (): The mysql_fetch_row () function returns a row from a result set as a numeric
array.
This function gets a row from the mysql_query () function and returns an array of success, or FALSE
on failure or when there are no more rows; mysql_fetch_row() fetches one row of data from the
result associated with the specified result identifier; the row is returned as an array.
Each result column is stored in an array offset, starting at offset 0.
2. mysql_fetch_array (): The mysql_fetch_array () function fetches a result row as an associative array
or a numeric array or using both the ways.
3. mysql_fetch_object (): The mysql_fetch_object () function fetches a result row as an object.
4. mysql_fetch_assoc (): The mysql_fetch_assoc () function fetches a result row as an associative
array.

Q2: What the differences are between require and include, include once, require once?

Ans. require :- when the file is required by your application, e.g. an important message template or a file
containing configuration variables without which the app would break.

require_once :- when the file contains content that would produce an error on subsequent inclusion,
e.g. function important () { /* important code */} is definitely needed in your application but since functions
cannot be redeclared should not be included again.

include :- when the file is not required and application flow should continue when not found, e.g.
great for templates referencing variables from the current scope or something

include_once :- optional dependencies that would produce errors on subsequent loading or maybe remote
file inclusion that you do not want to happen twice due to the HTTP overhead

Q3: What are the different types of errors in php?


Ans. There are various types of errors in PHP but it contains basically four main type of errors.

1) Parse error or Syntax Error: It is the type of error done by the programmer in the source
code of the program. The syntax error is caught by the compiler. After fixing the syntax
error the compiler compile the code and execute it. Parse errors can be caused dues to
unclosed quotes, missing or Extra parentheses, Unclosed braces, Missing semicolon etc
2) Fatal Error: It is the type of error where PHP compiler understands the PHP code but it
recognizes an undeclared function. This means that function is called without the definition
of function.
3) Warning Errors: The main reason of warning errors is including a missing file. This
means that the PHP function call the missing file.
4) Notice Error: It is similar to warning error. It means that the program contains something
wrong but it allows the execution of script.

Q4: What are the advantages of stored procedures, triggers, indexes?


Ans. Advantages of stored procedures:-
1. Maintainability.
2. Testing.
3. Isolation of Business Rules.
4. Speed / Optimization.
5. Utilization of Set-based Processing.
6. Security.

Advantages of triggers:-
1. Integrity of data.
2. Useful for catching errors.
3. Alternative way to run scheduled tasks.
4. Auditing.
5. Prevention of invalid transactions.
6. Logging of event.
Advantages of indexes:-
1. Searching For Records.
2. Sorting Records.
3. Grouping Records.
4. Maintaining a Unique Column.

Q5: Discuss the features of persistent cookie? Why it is used?


Ans. A persistent cookie is a data file capable of providing websites with user preferences, settings and
information for future visits. Persistent cookies provide convenient and rapid access to familiar objects,
which enhances the user experience (UX). A persistent cookie is also known as a stored or permanent
cookie. Persistent cookies facilitate setting the following preferences:
 Favourites or internal bookmarks
 User authentication
 Login details
 Menu preferences
 Theme selection, if applicable
 Language preferences

Persistent cookies are also capable of providing the browsing behaviour of users. Persistent cookies help
websites remember your information and settings when you visit them in the future. This result in faster and
more convenient access since, for example, you don't have to login again.

Besides authentication, other website features made possible by persistent cookies include: language
selection, theme selection, menu preferences, internal site bookmarks or favourites, among many others. On
your first visit, the website is presented in default mode. During your visit, you select your preferences and
these preferences are remembered, through the use of the persistent cookie, the next time you visit the site.

Вам также может понравиться