Webtech Lab Mannual
Webtech Lab Mannual
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
WOMEN’S POLYTECHNIC
HAPANIA, TRIPURA (WEST)
WEBTECHNOLOGY LAB
LAB MANNUAL
Cpw: 4 Credit: 2
For
3rd semester
Diploma Engineering in Information Technology
&
Diploma Engineering in Computer Science
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 1
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
INDEX
1 Lab Objective 3
2 Introduction About Lab 3
3 Guidelines to Student 4
4 Syllabus (TU) 4
5 Common Web Terminologies 6
6 List of Lab Exercise with solutions 9
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 2
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
LAB OBJECTIVE
This course is intended to:-
1. Teach the basics involved in publishing content on the World Wide Web. This includes
the ‘language of the Web’ – HTML
2. Give basic ideas about introduction to java application, applets-control and embedding
of applet code in HTML webpages.
3. Teach more advanced topics such as programming and scripting. This will also expose
students to the basic tools and applications used in Web publishing.
COURSE OUTCOMES:-
The students will be able to:
RAM : 4 GB
Software
JVM is installed in the machines so that students can create and run applet code in the
machine.
Browser are also installed in each of the machine.
Xammp is also installed in so that students can create and see the outputs of ASP
webpages.
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 3
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
GUIDELINES TO STUDENT:-
Computers and othet equipments in the lab for the use of student community. Students
need to maintain a proper decorum in the computer lab. Students must use the equipment
with care.
Students are required to carry their Lab copy every time during Webtech Lab.
Students must sign into the log register in the lab before occupying any machine every
time.
Students are not supposed to talk or make noise in the lab.
Lab records need to be submitted on or before date of submission.
SYLLABUS (TU)
Sessional / Practical subjects for 5th Semester
W E B T E C H N O L O G Y L A B (DCS-504S)
Total Marks: 100, Cpw: 4, credit: 2
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 4
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
HTML / Applet :
Creating simple HTML file, place it in web server and access it from client Browser.
Creating a HTML form incorporating GUI components (Command button, text box, radio
button, check box, combo box etc).
Creating a simple applet and embedding it in HTML file. Writing applet to in corporate GUI
components (Command button, text box, radio button, check box, combo box etc).
Writing applet to incorporate events.
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 5
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
WWW: WWW stands for "World Wide Web." It is important to know that this is not a synonym
for the Internet. The World Wide Web, or just "the Web," as ordinary people call it, is a subset of
the Internet with hyperlinked text, addio, video files and remote sites that can be accessed and
searched by browsers based on standrards such as HTTP and TCP/IP.
Internet: The Internet is the global system of interconnected computer networks that use
the Internet protocol suite (TCP/IP) to link devices worldwide. It is a network of networks that
consists of private, public, academic, business, and government networks of local to global
scope, linked by a broad array of electronic, wireless, and optical networking technologies. The
Internet carries a vast range of information resources and services, such as the inter-
linked hypertext documents and applications of the World Wide Web (WWW), electronic
mail, telephony, and file sharing.
SEARCH ENGINE: A web search engine is a software system that is designed to search for
information on the World Wide Web. The search results are generally presented in a line of
results often referred to as search engine results pages (SERPs). The information may be a
specialist in web pages, images, information and other types of files. Some search engines also
mine data available in databases or open directories. Unlike web directories, which are
maintained only by human editors, search engines also maintain real-time information by
running an algorithm on a web crawler.
A search engine operates in the following order:
1. Web crawling
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 6
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
2. Indexing
3. Searching
Webpage: Web pages are what make up the World Wide Web. These documents are written in
HTML (hypertext markup language) and are translated by your Web browser. Web pages can
either be static or dynamic. Static pages show the same content each time they are viewed.
Dynamic pages have content that can change each time they are accessed.
Website: A website is a collection of related web pages, including multimedia content, typically
identified with a common domain name, and published on at least one web server. Notable
examples are wikipedia.org, google.com, and amazon.com.
WEB PORTAL: A web portal is most often one specially-designed Web page at a website
which brings information together from diverse sources in a uniform way. Usually, each
information source gets its dedicated area on the page for displaying information (a portlet);
often, the user can configure which ones to display. Variants of portals include Mashup (web
application hybrid) and intranet"dashboards" for executives and managers.
HTML: HTML stands for "Hypertext Markup Language." HTML is the language used to
create webpages. "Hypertext" refers to the hyperlinks that an HTML page may contain. "Markup
language" refers to the way tags are used to define the page layout and elements within the page.
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 7
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
HTML Page Structure
<!doctype html>
<html>
<head>
<title>TechTerms.com</title>
</head>
<body>
<p>This is an example of a paragraph in HTML.</p>
</body>
</html>
ASP: An Active Server Page (ASP) is an HTML page that includes one or more scripts (small
embedded programs) that are processed on a Microsoft Web server before the page is sent to the
user. An ASP is somewhat similar to a server-side include or a common gateway interface (CGI)
application in that all involve programs that run on the server, usually tailoring a page for the
user. Typically, the script in the Web page at the server uses input received as the result of the
user's request for the page to access data from a database and then builds or customizes the
page on the fly before sending it to the requestor.
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 8
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
List of problems with solution on HTML Basics
a. Basics
To create an HTML document with the main structure elements (HTML, HEAD, BODY), save it
and display it on a browser.
To create an HTML document and add the following: (a) Comments, (b) Headings (H1 to H6),
(c) Paragraph, (d) Visual line break.
Problem 2: To make the background appear black, text lime , links yellow and
recently visited links red.
<HTML>
<HEAD>
<TITLE>Attributes of Body Tag </TITLE>
</HEAD>
<BODY bgcolor =”black” text= “white” link =”red” alink =”yellow”>
Informatics practices Class XII
<a href=”https://www.google.com”> Click here to access google search engine</a>
</BODY>
</HTML>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 9
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
Problem 3: To make body text appear 60 pixels away from the top edge of page and 75
pixels away from left edge of page.
<HTML>
<HEAD>
<TITLE>Usage of Margins </TITLE>
</HEAD>
<BODY topmargin = “60” leftmargin = “75”>
Information Technology is an important subject of Engineering.
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> Headings in HTML </TITLE>
</HEAD>
<BODY>
<H1> Level 1 Heading </H1>
<H2 align = “center”> Level 2 Heading </H2>
<H3> Level 3 Heading </H3>
<H4 align = “right”> Level 4 Heading </H4>
<H5> Level 5 Heading </H5>
<H6 align = “left”> Level 6 Heading </H6>
</BODY>
</HTML>
7. Display the output of <BR> tag - To end one line , and to jump to the next <BR> tag is
used.
<html>
<head>
<title> Paragraph</title>
</head>
<body>
Writing a line. I want to write in next line.<br/> I am in a new line.
</body>
<html>
<HTML>
<HEAD>
<TITLE> Various Horizontal Rule </TITLE>
</HEAD>
<BODY>
<P> This is conventional document text. </P>
<HR>
The next three horizontal rules are of different sizes.
<HR size=12>
<HR size =36>
<HR size =72>
<BODY>
</HTML>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 11
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
Problem 9: To display horizontal rules of different widths.
<HTML>
<HEAD>
<TITLE>Width of Horizontal Rule</TITLE>
</HEAD>
<BODY>
<P>
The following two rules have widths of 100 and 200 pixels respectively
<HR width=100><br><br>
<HR width=200>
</BODY>
</HTML>
Unsolved Problem:
GENERATIONS OF COMPUTER
The history of computer development is a computer science topic that is often used to reference
the different generations of computing devices.
Each one of the five generations of computers is characterized by a major technological
development that fundamentally changed the way computers operate. Most major developments
from the 1940's to present day have resulted in increasingly smaller, cheaper, more powerful and
more efficient computing devices.
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 12
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
b. Fonts, Colour, and Lists & Tables:
To create an HTML document and add the following: (a) Fonts, (b) Colors, (c) Lists, (d)Signature
Text blocks.
To create in an HTML document a Table and mention the following: (a) Table variables, (b)
Table element, (c) CAPTION element, (d) Table ROW element, (e) Table Data element,
(f) Table Heading element.
Problem 10: To display a paragraph on red color in size 4 but its first letter should be of
size 7 and of blue color.
<HTML>
<HEAD>
<TITLE>Base Font</TITLE>
</HEAD>
<BODY>
<FONT size=7 color=”blue”> U </FONT>
<FONT size=4 color=”red”> sing the largest font </FONT>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Font Faces</TITLE>
</HEAD>
<BODY>
<FONT size=7 color=”blue” face=”Broadway,Arial, Albertus”>
The font are displaying .
</FONT><br>
This is the text without any specific font.
</BODY>
</HTML>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 13
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
Problem 12: To display text by changing base font sizes.
<HTML>
<HEAD>
<TITLE> Base Font </TITLE>
</HEAD>
<BODY>
This text is being displayed in default font size as no basefont size hase beenset as yet.
<BASEFONT size =5>
This text has base font size =5.
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> Base Font </TITLE>
</HEAD>
<BODY background-color: #FFFF00; >
</HEAD>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> Base Font </TITLE>
</HEAD>
<BODY>
<P style="background-color:#99FFFF;">Background color is Hexadecimal</P>
</BODY>
</HTML>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 14
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
Problem 14: Setting a Background color set in <div> Tag.
<HTML>
<HEAD>
<TITLE> Base Font </TITLE>
</HEAD>
<BODY>
<DIV style="background-color:yellow; width:220px;" align="left">
<P>Division Section background background color is yellow and paragraph width is
220px.</P>
</DIV>
</BODY>
</HTML>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 15
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
B=255 B=204 B=153 B=102 B=51 B=0
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 16
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 17
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
B=255 B=204 B=153 B=102 B=51 B=0
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 18
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
G=153 G=153 G=153 G=153 G=153 G=153
B=255 B=204 B=153 B=102 B=51 B=0
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 19
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
R=0 R=0 R=0 R=0 R=0 R=0
G=51 G=51 G=51 G=51 G=51 G=51
B=255 B=204 B=153 B=102 B=51 B=0
Problem 15: To display the list items in unordered lists are marked with bullets (small
black circles), by default.
<html>
<body>
<ul>
<li>Chocolate Cake</li>
<li>Black Forest Cake</li>
<li>Pineapple Cake</li>
</ul>
</body>
</html>
<html>
<body>
<ul>
<li>Item one</li>
<li>Item two</li>
<li>Watch, you can easily nest list items: This item has some sub-items</li>
<ul>
<li>Sub-item one</li>
<li>Sub-item two</li>
<li>Shall we do a 3rd nested list?</li>
<ul>
<li>OK</li>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 20
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
<li>Your browser should automatically use different bullet styles for each level.</li>
</ul>
</ul>
</ul>
</body>
</html>
Problem 17: To display multiple ordered list with different types of bullets.
<html>
<body>
<ol style=”1”>
<li>Item one</li>
<li>Item two</li>
<li>Watch, you can easily nest list items: This item has some sub-items</li>
<ol style=”a”>
<li>Sub-item one</li>
<li>Sub-item two</li>
<li>Shall we do a 3rd nested list?</li>
<ol style=”i”>
<li>OK</li>
<li>Your browser should automatically use different bullet styles for each level.</li>
</ol>
</ol>
</ol>
</body>
</html>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 21
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
Problem 17: To display definition list with.
<html>
<body>
<dl>
<dt> The dl element </dt>
<dd>Paired tags define the start and end of a definition list.</dd>
<dt> The dt element </dt>
<dd>Paired tag that indicates the term being defined.</dd>
<dt> The dd element </dt>
<dd>Paired tag that indicates the definition of the term. Each term should be followed by a
definition.</dd>
</dl>
</body>
</html>
Unsolved problem:
WAP to display
The ingredients:
100 g. flour
10 g. sugar
1 cup water
2 eggs
salt, pepper
The procedure:
Notes:
The recipe may be improved by adding raisins.
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 22
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
Problem 18: To create signature using <div> tag.
<html>
<body>
<div>
Address: Agartala, Tripura<br>
Phone: 0381-526-2339<br>
Web: www.xyz.com<br>
</div>
</body>
</html>
<html>
<body>
<div>
Address: Agartala, Tripura <a href="https://www.abc.com">India.</a><br>
Phone: <a href="callto:0381-526-2339">0381-526-2339</a><br>
Web: <a href="https://www.xyz.com">www.xyz.com</a><br>
</div>
</body>
</html>
<html>
<body>
<table>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 23
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
<td>row 2, cell 2</td>
</tr>
</table>
</body>
<html>
<html>
<body>
<table border="1">
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
<table border="5">
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
<html>
<body>
<table border="1">
<tr>
<th>Heading</th>
<th>Another Heading</th>
</tr>
<tr>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 24
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
</body>
<html>
<html>
<body>
<table border="1" cellspacing="5">
<tr>
<td>some text</td>
</tr><tr>
<td>some text</td>
</tr>
</table>
<body>
<html>
<html>
<body>
<table border="1" cellpadding="10">
<tr>
<td>some text</td>
</tr><tr>
<td>some text</td>
</tr>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 25
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
</table>
</body>
</html>
Problem 23: To display a simple table with cellspacing,cellpadding, width and border
attribute.
<HTML>
<BODY>
</BODY>
</HTML>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 26
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td rowspan = "2">Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan = "3">Row 3 Cell 1</td>
</tr>
</table>
</body>
</html>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 27
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
<td rowspan = "2">Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan = "3">Row 3 Cell 1</td>
</tr>
</table>
</body>
</html>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 28
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</tbody>
</table>
</body>
</html>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 29
Department of Information Technology
&
Department of Computer Science WebTechnology Lab Mannual
----------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------
c. Hyper Links, Frames & Images :
To create a web page using HTML and clarify the following: (a) how to create hyperlink, (b)
how to create frames, (c) how to Insert an image.
--------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset cols = "25%,50%,25%">
<frame name = "left" src = "/html/top_frame.htm" />
<frame name = "center" src = "/html/main_frame.htm" />
<frame name = "right" src = "/html/bottom_frame.htm" />
</frameset>
</html>
Prepared by,
Soma Saha
Lecturer (Sr. Scale),
Department of Information Technology
Women’s Polytechnic, Hapania Page 30