Web Technologies Lab Manual
Web Technologies Lab Manual
LAB MANUAL
for
(R22)
0
INDEX
6 Lab Manual 9
9
EXPERIMENT 1.
Create HOME PAGE for an online book
store.
12
EXPERIMENT 2.
Login page for an online book store
13
EXPERIMENT 3.
.Create CATOLOGUE PAGE
EXPERIMENT 4. 23
Create registration form with the
following fields Name, Password,
confirm password, Email id, Phone
number, Sex, Date of birth, Address
EXPERIMENT 5. 27
Write JavaScript to validate the
following fields of the above registration
modify web page appearance using CSS
EXPERIMENT 6. 61
1
to validate this XML document. Create
CSS, XSL do display XML data
EXPERIMENT 7. 33
Install XAMPP and JOOMLA or Word
Press and test.
EXPERIMENT 8. 51
Write Servlet Program to read data
submitted from Registration form and
store it into the MySql database
EXPERIMENT 9. 55
Write a JSP program user validation web
application to read username and
password submitted by the user and
return successful login if the data
matches ,otherwise failure login
EXPERIMENT 10. 57
Write a PHP program to store current
date-time in a COOKIE and display the
“Last visited on‟ date-time on the web
page upon reopening of the same page..
EXPERIMENT 11. 58
Write a PHP program to store page
views count in SESSION, to increment
the count on each refresh, and to show
the count on we page. Apply web
application software tools i.e
AJAX,PHP and xml [Link] identify
the environments currently available on
the market to design web sites.
EXPERIMENT 12. 59
Using PHP and MySQL, develop a
program to accept book information viz.
Accession number, title, authors, edition
and publisher from a web page and store
the information in a database and to
search for a book with the title specified
by the user and to display the search
results with proper headings.
7 Viva Questions
2
1. Vision, Mission
Vision
To meet the emerging trends in computer Science and Engineering,
strive for self-reliance enabled through high end research by adapting a
futuristic approach.
Mission
➢ To impart qualitative education, prepare students refurbish their latent
talents and aspire for a pragmatic career in Computer Science and
Engineering
➢ To provide an ambiance to develop strategic areas of advance study with
perception to foster industry centric education in computer science and
Engineering.
➢ To Inculcate self-learning among students to make them self-reliant
and socially responsible.
PEOs
.
Program Educational Objectives (PEOs):
To prepare graduates to apply the knowledge and skills acquired in
PEO1 Mathematics, Basic Science and Engineering to succeed in their career,
pursue research and or obtain higher / advanced degree.
To prepare graduates to learn emerging technologies, work in
multidisciplinary fields, apply computer engineering solutions within a
PEO2
global, societal, environmental context, acquire leadership qualities and
enable them to become successful entrepreneurs.
To prepare graduates communicate effectively, exhibit professionalism
PEO3
with integrity, morals, ethical conduct and engage in lifelong learning.
3
2. POs & PSOs
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
4
receive clear instructions..
PO11 Project Management and Finance: Demonstrate knowledge and
understanding of engineering and management principles and apply
these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO12 Life-long Learning: Recognize the need for and have the preparation
and ability to engage in independent and life- long learning in the
broadest context of technological change. Any signatory needs to
provide an overview of its learning outcomes and confirm that
compliance of programs.
PSO2 Ability to test and analyze quality of various systems to integrate them
in larger computer systems.
5
Course outcome
[Link] LAB OUTCOMES- After completing this lab the student will be able to:
1 Analyze and design dynamic web pages
6
4. Course Syllabus / List of Experiments
(Syllabus Copy)
Write a JSP program user validation web application to read username and
password submitted by the user and return successful login if the data matches
,otherwise failure login
7
EXPERIMENT 10.
Write a PHP program to store current date-time in a COOKIE and display
the “Last visited on‟ date-time on the web page upon reopening of the
same page.
EXPERIMENT 11.
Write a PHP program to store page views count in SESSION, to increment the
count on each refresh, and to show the count on we page. Apply web
application software tools i.e AJAX,PHP and xml [Link] identify the
environments currently available on the market to design web sites
EXPERIMENT 12.
Using PHP and MySQL, develop a program to accept book information viz.
Accession number, title, authors, edition and publisher from a web page
and store the information in a database and to search for a book with the
title specified by the user and to display the search results with proper
[Link] specified by the user and to display the search results with
proper headings.
5. CO & PO Mapping
WEB TECHNOLOGY
COURSE PROGRAM
SPECIFIC
OUTCOME PROGRAM OUTCOMES (PO’s) OUTCOMES
S (CO’s) (PSO’S)
P P PO PO PO PO PO PO PO PO1 PO11 PO PSO PSO
O O 3 4 5 6 7 8 9 0 1 1 2
1 2 2
CO1 3 3 3 2
CO2 2 2 3 2
CO3 2 3 2 3
CO4 2 3 2 3
CO5 3 3 2 3
Target 2.40 2.80 2.40 2.60
Attainm
ent
8
[Link] Manual
EXPERIMENT -1
[Link] HOME PAGE for an online book store.
Procedure:
[Link]
<html>
<head>
<title>Main</title>
<FRAMESET rows="20%,8%,*">
<frame src="[Link]" id="f">
<frame src="[Link]" id="f1">
<FRAMESET cols="11%,*" >
<frame src="[Link]" id="f2">
<frame src="[Link]" id="main">
</FRAMESET >
</head>
<body>
</body>
</html>
[Link]
<html>
<head>
<title>Home Page</title>
</head>
<body>
<h1 style="text-align:center">Welcome to Online Shopping Site</h1>
<imgsrc="images/[Link]" width="800" height="300" border="0">
</body>
</html>
[Link]
<html>
<head>
<title>Top Page</title>
</head>
<body bgcolor="#005387">
<table width="100%">
<tr>
<td align=center><imgsrc="images/[Link]" align="left"></td>
<td align=center><h1 align="center" ><font face="Algerian" size="10"
color="white">Online Shopping Site</h1></td>
</tr>
</table>
</body>
</html>
9
[Link]
<html>
<head>
<title>Branches list</title>
</head>
<body bgcolor="#99ffff">
<table cellspacing="20" >
<i><font size="4" >Select Your Branch</i>
<tr><td><a href="[Link]" target="main"><font size="5"
color="black">CSE</a></td></tr>
<tr><td><a href="[Link]" target="main"><font size="5"
color="black">ECE</a></td></tr>
<tr><td><a href="[Link]" target="main"><font
size="5"color="black">EEE</a></td></tr>
<tr><td><a href="[Link]" target="main"><font size="5"
color="black">MECH</a></td></tr>
<tr><td><a href="[Link]" target="main"><font size="5"
color="black">CIVIL</a></td></tr>
</font>
</table>
</body>
</html>
[Link]
<html>
<head>
<title> Navigation Page </title>
</head>
<body bgcolor="#333">
<table width="100%" border="0" cellspacing="5" align="top">
<tr>
<td align="center">
<a href="[Link]" target="main" >
<Font face="Algerian" size="4" color="#ffffff">Home
</a>
</td>
<td align="center">
<a href="[Link]" target="main">
<Font face="Algerian" size="4" color="#ffffff">Login
</a></td>
<td align="center">
<a href="[Link]" target="main">
<Font face="Algerian" size="4" color="#ffffff">Registration
</a></td>
<td align="center">
<a href="[Link]" target="main">
<Font face="Algerian" size="4" color="#ffffff">Catalogue
</a></td>
<td align="center">
<a href="[Link]" target="main">
10
<Font face="Algerian" size="4" color="#ffffff">Cart
</a></td></tr>
</table>
</body>
</html>
O/p:
EXPERIMENT -2
[Link] page for an online book store
11
[Link]
<html>
<head>
<title>Login Page</title>
</head>
<body>
<Form name="MyForm">
<table align="center" width="30%" bgcolor="#99ccff">
<tr>
<td>Login</td>
<td><input type="text" id="txtbx" placeholder="User ID"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" id="pwd" placeholder="Password"></td></tr>
<tr>
<td><input type="Submit" value="Submit"></td>
<td><input type="Reset" value="Reset"></td>
</tr>
</table>
</Form>
</body>
</html>
O/P:
EXPERIMENT -3
3. Create CATOLOUGE PAGE
12
[Link]
<html>
<head>
<title>[Link]</title>
</head>
<body>
<marquee bgcolor="red"><font color="white" size="4">Please Select your Branch to add
books to the CART</marquee>
<table align="center" id="catlog" width="60%" border="1">
<tr>
<td align="center"><h2>Preview</h2></td>
<td align="center"><h2>Description</h2></td>
<td align="center"><h2>Price</h2></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Electronic Devices&Circuits<br>
<b>Author:</b>Millman And Hawkins<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td align="center">
<b>$40.5</b><br>
(inclusive of all taxes)
</td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Programming in C<br>
<b>Author:</b>Balagurusamy<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td align="center">
<b >$40.5</b><br>
(inclusive of all taxes)
</td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Programming in C++<br>
<b>Author:</b>Balagurusamy<br>
<b>Publication:</b>Technical Publication<br>
<b>Availability:</b>Available<br>
</td>
<td align="center">
<b>$53</b><br>
13
(inclusive of all taxes)
</td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Signalling Systems<br>
<b>Author:</b>Travis Russel<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td align="center">
<b>$68</b><br>
(inclusive of all taxes)
</td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Computer Organisation<br>
<b>Author:</b> William Stallings<br>
<b>Publication:</b>Pearson Publications<br>
<b>Availability:</b>Available<br>
</td>
<td align="center">
<b>$80</b><br>
(inclusive of all taxes)
</td>
</tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Embeded Systems<br>
<b>Author:</b>Shibu K V<br>
<b>Publication:</b>Technical Publication<br>
<b>Availability:</b>Available<br>
</td>
<td align="center">
<b>$53</b><br>
(inclusive of all taxes)
</td>
</table>
</body>
</html>
[Link]
<html>
<head>
<title>Civil Catalogue</title>
</head>
<body>
14
<table align="center" width="70%" border="1" id="ece">
<tr>
<td><h2>Preview</h2></td>
<td><h2>Description</h2></td>
<td><h2>Price</h2></td>
<td><h2>Cart</h2></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>TextBook Of Geology<br>
<b>Author:</b>Millman And Hawkins<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$40.5</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Strength of Materials<br>
<b>Author:</b>Shibu K V<br>
<b>Publication:</b>Technical Publication<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$53</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Civil Engg Drawing<br>
<b>Author:</b>Travis Russel<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$68</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
15
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Contracts and Estimates<br>
<b>Author:</b> William Stallings<br>
<b>Publication:</b>Pearson Publications<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$80</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
</table>
</body>
</html>
[Link]
<html>
<head>
<title>CseCatalogue</title>
</head>
<body>
<table align="center" width="70%" border="1" id="cse" method="get">
<tr>
<td><h2>Preview</h2></td>
<td><h2>Description</h2></td>
<td><h2>Price</h2></td>
<td><h2>Cart</h2></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td id="name">
<b>Book:</b>Programming in C<br>
<b>Author:</b>Balagurusamy<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$40.5</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Programming in C++<br>
<b>Author:</b>Balagurusamy<br>
16
<b>Publication:</b>Technical Publication<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$53</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>JAVA Complete Reference<br>
<b>Author:</b>Herb Schildt<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$68</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Web Technologies Black Book<br>
<b>Author:</b>Kogent Learning Solutions<br>
<b>Publication:</b>Pearson Publications<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$80</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
</table>
</body>
</html>
Ece [Link]
<html>
<head>
<title>EceCatalogue</title>
</head>
<body>
<table align="center" width="70%" border="1" id="ece">
17
<tr>
<td><h2>Preview</h2></td>
<td><h2>Description</h2></td>
<td><h2>Price</h2></td>
<td><h2>Cart</h2></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Electronic Devices And Circuits<br>
<b>Author:</b>Millman And Hawkins<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$40.5</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Embeded Systems<br>
<b>Author:</b>Shibu K V<br>
<b>Publication:</b>Technical Publication<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$53</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Signalling Systems<br>
<b>Author:</b>Travis Russel<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$68</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
18
<td>
<b>Book:</b>Computer Organisation<br>
<b>Author:</b> William Stallings<br>
<b>Publication:</b>Pearson Publications<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$80</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
</table>
</body>
</html>
EEE [Link]
<html>
<head>
<title>EEE Catalogue</title>
</head>
<body>
<table align="center" width="70%" border="1" id="ece">
<tr>
<td><h2>Preview</h2></td>
<td><h2>Description</h2></td>
<td><h2>Price</h2></td>
<td><h2>Cart</h2></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Power Systems<br>
<b>Author:</b>Millman And Hawkins<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$40.5</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Control Engineering<br>
<b>Author:</b>Shibu K V<br>
19
<b>Publication:</b>Technical Publication<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$53</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Network Analysis,Architecture and Design<br>
<b>Author:</b>Travis Russel<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$68</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Electrical Technology<br>
<b>Author:</b> William Stallings<br>
<b>Publication:</b>Pearson Publications<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$80</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
</table>
</body>
</html>
[Link]
<html>
<head>
<title>MechCatalogue</title>
</head>
<body>
<table align="center" width="70%" border="1" id="ece">
<tr>
20
<td><h2>Preview</h2></td>
<td><h2>Description</h2></td>
<td><h2>Price</h2></td>
<td><h2>Cart</h2></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Solid Mechanics<br>
<b>Author:</b>Millman And Hawkins<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$40.5</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Thermodynamics<br>
<b>Author:</b>Shibu K V<br>
<b>Publication:</b>Technical Publication<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$53</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
<b>Book:</b>Fluid Mechanics And Hydraulic Machines<br>
<b>Author:</b>Travis Russel<br>
<b>Publication:</b>Tata McGrawhills<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$68</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
<tr>
<td><imgsrc="images/[Link]"></td>
<td>
21
<b>Book:</b>Practical Metallurgy<br>
<b>Author:</b> William Stallings<br>
<b>Publication:</b>Pearson Publications<br>
<b>Availability:</b>Available<br>
</td>
<td>
<b>$80</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/[Link]"></a></td>
</tr>
</table>
</body>
</html>
O/P:
EXPERIMENT -4
Create registration form with the following fields Name,Password ,Confirm password,
22
E-mail id,Phonenumber,Sex,Date of birth,Address
Registration Page:
<html>
<head>
<title>Registration Page</title>
</head>
<body>
<h1 align="center">Registration Form</h1>
<form name="MyForm">
<table align="center" cellspacing="5" cellpadding="2" bgcolor="#b7eff9">
<tr>
<td>Name</td>
<td><input type="text" name="txtbx" Autofocus></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pwd"></td>
</tr>
<tr>
<td>Confirm Password</td>
<td><input type="password" name="pwd2"></td>
</tr>
<tr>
<td>Date of Birth</td>
</tr>
<tr>
<td>Day
<select id="day">
<option>1
<option>2
<option>3
<option>4
<option>5
<option>6
<option>7
<option>8
<option>9
<option>10
<option>11
<option>12
<option>13
<option>14
<option>15
<option>16
<option>17
23
<option>18
<option>19
<option>20
<option>21
<option>22
<option>23
<option>24
<option>25
<option>26
<option>27
<option>28
<option>29
<option>30
<option>31
</select>
</td>
<td>Month
<select name="month" id="month">
<option value=01>JAN</option>
<option value=02>FEB</option>
<option value=03>MAR</option>
<option value=04>APR</option>
<option value=05>MAY</option>
<option value=06>JUN</option>
<option value=07>JUL</option>
<option value=08>AUG</option>
<option value=09>SEP</option>
<option value=10>OCT</option>
<option value=11>NOV</option>
<option value=12>DEC</option>
</select>
</td>
<td>Year
<select id="year">
<option>1981
<option>1982
<option>1983
<option>1984
<option>1985
<option>1986
<option>1987
<option>1988
<option>1989
<option>1990
<option>1991
<option>1992
<option>1993
<option>1994
<option>1995
24
<option>1996
<option>1997
<option>1998
<option>1999
<option>2000
</select></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="radbtn">Male <input type="radio"
name="radbtn">Female</td>
</tr>
<tr>
<td>Email Id</td>
<td><input type="text" name="emailbx"></td>
</tr>
<tr>
<td>Mobile Number</td>
<td><input type="text" name="mobnumbx"></td>
</tr>
<tr>
<td>Languages Known</td>
</tr>
<tr>
<td>Hindi<input type="checkbox"></td>
<td>Telugu<input type="checkbox"></td>
<td>English<input type="checkbox"></td>
<td>Tamil<input type="checkbox"></td>
<td>Marati<input type="checkbox"></td>
</tr>
<tr>
<td>Address</td>
<td><textarea rows="5" cols="25" style="overflow:hidden;" ></textarea></td>
</tr>
<tr>
<td><input type="submit" value="Submit" onclick="FormValidation()"></td>
<td><input type="reset" value="Reset"></td>
</tr>
</table></form></body></html>
O/P:
25
EXPERIMENT-5
26
Write a Java Script to validate the following fields of the registration modify web page
[Link]
<html>
<head>
<title>Registration</title>
<script src="[Link]">
</script>
</head>
<body bgcolor=#7D9EC0>
<center>
<form name=f>
<table align=center border=0 width=65% height=100%>
<caption align=center> REGISTRATION FORM </caption>
<tr>
<td>UserName :</td>
<td ><input type=text name=user></td>
</td>
</tr>
<tr>
<td>Password:</td>
<td ><input type=password name=pwd></td>
</tr>
<tr>
<td>E-mail id:</td>
<td ><input type=text name=email></td>
</tr>
<tr>
<td>Phone Number:</td>
<td><input type=text name=phone></td>
<td><p id= "ph"></p></td>
</tr>
<tr>
<td><input type=button value="Submit" onclick=validate()></td>
<td><input type=reset value="Reset"></td>
</tr>
</table></form>
</body>
</html>
[Link]
function validate()
{
var c1=new RegExp("^[\\w]{6,}$");
27
var c2=new RegExp("^[\\w]{6,}$");
var c3=new RegExp("^[\\w]+@[\\w]+.com$");
var c4=new RegExp("^[\\d]{10}$");
var name=[Link];
varpwd=[Link];
var email=[Link];
var phone=[Link];
var error="";
if(!name.
match(c1))
{ error+="should be min of 6 char\n" }
if()
{
error+="should be min of 6 char\n"
}
if()
{
error+="should be of format name@[Link]\n"
}Procedure:
if()
{
error+="should be of 10 digits"
}
if(error!="")
{
[Link](error);
}
else {
[Link]("u entered valid information");
}
}
28
Out put:
29
EXPERIMENT -6
Write an XML file which will display the your Books information such as
title,author,isbn,name of the publisher. Create a DTD, XML Schemas to validate this
XML [Link] CSS, XSL do display XML data
Procedure:
30
<publisher>Wiley Dreamtech</publisher>
<edition>2nd edition</edition>
<price>Rs.250</price>
</book>
<book>
<title>The Unified Modelling language User Guide</title>
<author>GradyBooch,JamesRumbaugh,IvarJacabson</author>
<ISBN>81-7758-372-7</ISBN>
<publisher>Perarson Education</publisher>
<edition>2nd edition</edition>
<price>Rs.400</price>
</book>
<book>
<title>Data mining - Concepts and techniques </title>
<author>JiaweiHAn and Kamber</author>
<ISBN>978-81-312-0538-8</ISBN>
<publisher>Pearson</publisher>
<edition>1st edition</edition>
<price>Rs.550</price>
</book>
</books>
31
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Output:
32
EXPERIMENT-7
Install XAMPP and JOOMLA or Word press and test
STEPS FOR INSTALLING XAMPP
1. In your web browser, go to [Link]
3. When prompted for the download, click "Save" and wait for your download to finish.
33
4. Open CD or DVD drive from My Computer. Install the program, and click on "Run."
[Link] the default settings. A command will open and offer an initial installation prompt.
Just hit the Enter key, and accept the default settings. To simplify installation, just hit ENTER
when prompted on the command line. You can always change settings, by editing the
configuration files later.
34
[Link] your installation is complete, exit the command window by typing x on the
command line.
35
8 .Start the Apache and MySQL components. You can also start the other components, if
you plan to use them.
[Link] the Apache install, by clicking on the Apache administrative link in the Control
Panel.
36
[Link] the MySQL installation, by clicking on the MySQL administrative link in the
XAMPP Control Panel.
If the verification steps are successful, XAMPP should be successfully installed on your PC.
Open a browser and enter "localhost" on your address bar. You will be redirected to a page
telling you that you've successfully installed xampp on your system
37
INSTALLING JOOMLA
Step-1: Select language
Step-3:
38
Step-4:Select a folder joomla
39
Step-6:Click on next button
40
Step-8:Enter existing mail id
41
Step-10:Click on next button
42
Step-12:Installation is being processed
43
44
INSTALLING WORDPRESS:
Step-1:
45
46
Step-4.1
47
Step-4.2
Step-4.3
48
f sf f sf
49
50
EXPERIMENT-8
Write SERVLET Program to read data submitted from Registration form and store
into the Mysql database
Procedure:
i. [Link]
ii. [Link]
iii. [Link]
[Link]
<!doctype html>
<body>
<form action="servlet/Register" method="post">
<fieldset style="width:20%; background-color:#ccffeb">
<h2 align="center">Registration form</h2><hr>
<table>
<tr>
<td>Name</td>
<td><input type="text" name="userName" required /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="userPass" required /></td>
</tr>
<tr>
<td>Email Id</td>
<td><input type="text" name="userEmail" required /></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="text" name="userMobile" required/></td>
</tr>
<tr>
<td>Date of Birth</td>
<td><input type="date" name="userDOB" required/></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="gender" value="male" checked> Male
<input type="radio" name="gender" value="female"> Female </td></tr>
51
<tr>
<td>Country</td>
<td><select name="userCountry" style="width:130px">
<option>Select a country</option>
<option>India</option>
<option>America</option>
<option>England</option>
<option>other</option></select>
</td>
</tr>
<tr>
<td><input type="reset" value="Reset"/></td>
<td><input type="submit" value="Register"/></td>
</tr>
</table>
</fieldset>
</form>
</body>
</html>
[Link]
import [Link].*;
import [Link].*;
import [Link];
import [Link].*;
try
{
//load the driver
[Link]("[Link]");
//create connection object
Connection con=[Link](
"jdbc:oracle:thin:@localhost:1521:xe","local","test");
52
// create the prepared statement object
PreparedStatement ps=[Link]("insert into registration values(?,?,?,?,?,?,?)");
[Link](1,name);
[Link](2,pwd);
[Link](3,email);
[Link](4, mobile);
[Link](5,dob);
[Link](6,gender);
[Link](7,country);
int i = [Link]();
if(i>0)
[Link]("You are successfully registered...");
}
catch (Exception ex)
{
[Link]();
}
[Link]();
}
}
[Link]
<web-app>
<servlet>
<servlet-name>Register</servlet-name>
<servlet-class>Register</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Register</servlet-name>
<url-pattern>/servlet/Register</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>[Link]</welcome-file>
</welcome-file-list>
</web-app>
53
Output:2
Check the record on the database, the textbox value will be inserted
54
EXPERIMENT-9
Write a JSP program user validation web application to read username and password
submitted by the user and return successful login if the data matches,otherwise failure
login
Procedure:
[Link]:
<html>
<head>
<title> login page </title>
</head>
<body bgcolor="cyan"><center>
<right>
<form action="[Link]" method="post" >
<h4>username<input type="text" name="t1">
<h4>password <input type="password" name="t2" ><br><br>
<input type="submit" value="submit">
<input type="reset" value="reset"></form>
</body>
</html>
[Link]:
<%@ page language="java" import="[Link].*,[Link].*" %>
<html>
<form>
<%
int v=0;
String v1,v2,v3,v4,str;
v1=[Link]("t1");
v2=[Link]("t2");
try{
[Link]("[Link]");
Connection cn=[Link]("jdbc:odbc:oradsn","scott","tiger");
Statement st=[Link]();
ResultSetrs=[Link]("select * from register");
55
while([Link]())
{
if([Link](1)==v1 &&[Link](2)==v2)
{
v=1;
}
}
if(cn!=null && v==1)
{
%>
</form>
Login Successfull
<%
}
else
{
[Link]("Login failed");
}
[Link]();
[Link]();
}catch(Exception e) { [Link]("Error Occured. \n Login failed");
%>
<P><a href = "[Link]" target =f2 ><B> Back<B></a>
<%
}
%>
</body></html>
Output:
56
EXPERIMENT-10
Write a PHP program to store current date time in a COOKIE and display the “Last
visited on” date-time On the web page upon reopening of the same page.
PROGRAM:
<?php
//date_default_timezone_set('Asia/Calcutta');
//Calculate 60 days in the future
//seconds * minutes * hours * days + current time
$inTwoMonths = 60 * 60 * 24 * 60 + time();
setcookie('lastVisit', date("G:i - m/d/y"), $inTwoMonths);
if(isset($_COOKIE['lastVisit']))
{
$visit = $_COOKIE['lastVisit'];
echo "Your last visit was - ". $visit;
}
else
echo "You've got some stale cookies!";
?>
<html>
<body>
<form name="f" action="[Link]" method="get">
userid: <input type="text" name="t1"/><br>
password: <input type="password" name="p1"/><br/>
<input type="submit" value="submit"/>
</form>
</body>
</html>
57
EXPERIMENT-11
Write a PHP program to store page views count in SESSION,to increment the
count on each refresh,and to show the count we page
LOGIN .PHP
<html>
<body>
<form name="f" action="[Link]"method="get">
userid:<input type="text" name="t1"/><br/><br/>
password:<input type="password" name="p1"/><br/>
<input type="submit" value="submit"/>
</form>
</body>
</html>
[Link]
<?php
session_start();
$_SESSION["user1"]="pwd1";
$_SESSION["user2"]="pwd2";
$_SESSION["user3"]="pwd3";
$user=$_GET["t1"];
$pwd=$_GET["p1"];
if($_SESSION[$user]==$pwd)
echo "welcome" , $user;
else
echo "you are not an authorized user";
?>
58
EXPERIMENT-12
Using PHP and MySQL,develop a program to accept book information
[Link],title,authors,edition and publisher from a web page and store the
information in a database and to search for a book with the title specified by the user and
to display the search results with proper headings.
PROGRAM:
[Link]
<html>
<body>
<form action=”[Link]”>
Name:<Input type=”text” name=”username”/><br>
Password:<Input type=”password” name=”user pass”/><br>
Email Id:<Input type=”text” name=”user email”/><br>
Country:<select name=”user country”>
<option>INDIA</option>
<option>PAKISTAN</option>
<option>OTHER</option>
</select><br>
<Input type=”submit” value=”register”/>
</form>
</body>
</html>
[Link]
<?php
$_user=$_get[“user name”];
$pwd=$_get[“user pass”];
$email=$_get[“user email”];
$country=$_get[“user country”];
$dbhost=”localhost:3306”;
$dbuser=”root”;
$conn=mysql_connect($dbhost,$dbuser);
if(!$conn)
{
die(‘could not connect:’.mysql=error());
}
mysql_selct_db(‘sreekanth’);
$update_sql=”insert into register user values(‘$user’,’$pwd’,’$email’,’$country’)”;
$update val=mysql_query($update_sql,$conn);
if(!$updateval)
echo”record not updated”;
else
echo”record updated successfully”;
$sql=’select*from registeruser’;
$retval=mysql_query($sql,$conn);
if(!$retval)
die(‘couldnot get daqta:’mysql_error());
59
echo”<center>registration detailsare”;
echo”<table border=1>”;
while($row=mysql_fetch_array($retval,MYSQL_ASSOC))
{
echo”<tr><td>{$row[‘user email’]}</td><td>”;
echo”{$row[‘useremail’]}</td><td>”;
echo”{$row[‘usercountry’]}</td></tr>”;
}
echo”</table></center>”;
mysql_close($conn);
?>
60
[Link] Questions
• What is html?
• What is tag?
• What are Html5 new elements?
• By using which tag we can divide the page?
• Hyperlink can be given by using which tag?
• What are the attributes of Frame tag?
• How we can align a table to right?
• How I can insert Image in to web page?
• What is web page?
• What is css?
• Table properties?
• What is javascript?
• Servlets lifecycle?
• Apache tomcat directory structure?
• Xammp and zoomla description?
• Explain jdbc connection?
• Php?
• What are codesnippets?
• What is cms?
• How Jdbc connection is established in php
61