0% found this document useful (0 votes)
20 views

Web Technology Lab Ma

The document describes creating an online bookstore website. It includes code for the homepage, navigation pages, login page, and catalog pages for different branches (CSE, ECE, etc). The homepage uses frames to display header, navigation, and content sections. The navigation page includes links to home, login, registration, catalog, and cart pages. The catalog pages display books with images, descriptions, prices, and add to cart buttons for each branch.

Uploaded by

Akhil akhilesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Web Technology Lab Ma

The document describes creating an online bookstore website. It includes code for the homepage, navigation pages, login page, and catalog pages for different branches (CSE, ECE, etc). The homepage uses frames to display header, navigation, and content sections. The navigation page includes links to home, login, registration, catalog, and cart pages. The catalog pages display books with images, descriptions, prices, and add to cart buttons for each branch.

Uploaded by

Akhil akhilesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

B Input input tyo EXPERIMENT -1

1.Create HOME PAGE for an online book store.

Procedure:

Main.html
<html>
<head>
<title>Main</title>
<FRAMESET rows=”20%,8%,8”>
<frame src=”TopPage.html”id=”f”>
<frame src=”NavigationPagehtml”id=”f1”>
<FRAMESET cols=”11%,*>
<frame src=”Branches.html”id=”f2”>
<frame src=”Home.html”id=”main””>
</FRAMESET>
</head>
<body>
</body>
</html>

Home.html
<html>
<head>
<title>Home Page</title>
</head>
<body>
<h1 style="text-align:center">Welcome to Online Shopping Site</h1>
<imgsrc="images/home.jpg" width="800" height="300" border="0">
</body>
</html>

TopPage.html
<html>
<head>
<title>Top Page</title>
</head>
<body bgcolor="#005387">
<table width="100%">
<tr>
<td align=center><imgsrc="images/ons.jpg" align="left"></td>
<td align=center><h1 align="center" ><font face="Algerian" size="10" color="white">Online
Shopping Site</h1></td>
</tr>
</table>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 1
</body>
</html>

Branches.html
<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="CseCatalogue.html" target="main"><font size="5"
color="black">CSE</a></td></tr>
<tr><td><a href="EceCatalogue.html" target="main"><font size="5"
color="black">ECE</a></td></tr>
<tr><td><a href="EEECatalogue.html" target="main"><font
size="5"color="black">EEE</a></td></tr>
<tr><td><a href="MechCatalogue.html" target="main"><font size="5"
color="black">MECH</a></td></tr>
<tr><td><a href="CivilCatalogue.html" target="main"><font size="5"
color="black">CIVIL</a></td></tr>
</font>
</table>
</body>
</html>

NavigationPage.html
<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="Home.html" target="main" >
<Font face="Algerian" size="4" color="#ffffff">Home
</a>
</td>
<td align="center">
<a href="Login.html" target="main">
<Font face="Algerian" size="4" color="#ffffff">Login
</a></td>
<td align="center">
<a href="RegistrationPage.html" target="main">
<Font face="Algerian" size="4" color="#ffffff">Registration

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 2
</a></td>
<td align="center">
<a href="Catalogue.html" target="main">
<Font face="Algerian" size="4" color="#ffffff">Catalogue
</a></td>
<td align="center">
<a href="CartPage.html" target="main">
<Font face="Algerian" size="4" color="#ffffff">Cart
</a></td></tr>
</table>
</body>
</html>

O/p:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 3
EXPERIMENT -2
2.Login page for an online book store

Login.html
<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:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 4
EXPERIMENT -3
3. Create CATOLOUGE PAGE

Catalog.html
<html>
<head>
<title>Catalogue.html</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/e2.jpg"></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/1.jpg"></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>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 5
<tr>
<td><imgsrc="images/2.jpg"></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>
(inclusive of all taxes)
</td>
</tr>
<tr>
<td><imgsrc="images/e4.jpg"></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/e1.jpg"></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/ee2.jpg"></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>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 6
<td align="center">
<b>$53</b><br>
(inclusive of all taxes)
</td>
</table>
</body>
</html>

CivilCatalogue.html
<html>
<head>
<title>Civil 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/c1.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/c2.jpg"></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)

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 7
</td>
<td><a href=""><imgsrc="images/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/c3.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/c4.jpg"></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/Addtocart.jpg"></a></td>
</tr>
</table>
</body>
</html>

CseCatalogue.html
<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>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 8
<td><h2>Price</h2></td>
<td><h2>Cart</h2></td>
</tr>
<tr>
<td><imgsrc="images/1.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/2.jpg"></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>
<b>$53</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/3.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 9
<td><imgsrc="images/4.jpg"></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/Addtocart.jpg"></a></td>
</tr>
</table>
</body>
</html>

Ece Catalogue.html
<html>
<head>
<title>EceCatalogue</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/e2.jpg"></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)
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 10
</td>
<td><a href=""><imgsrc="images/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/e3.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/e4.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/e1.jpg"></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>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 11
<b>$80</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/Addtocart.jpg"></a></td>
</tr>
</table>
</body>
</html>

EEE Catalogue.html
<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/ee1.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/ee2.jpg"></td>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 12
<td>
<b>Book:</b>Control Engineering<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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/ee3.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/ee4.jpg"></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/Addtocart.jpg"></a></td>
</tr>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 13
</table>
</body>
</html>

MechCatalogue.html
<html>
<head>
<title>MechCatalogue</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/m1.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/m2.jpg"></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>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 14
<td>
<b>$53</b><br>
(inclusive of all taxes)
</td>
<td><a href=""><imgsrc="images/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/m3.jpg"></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/Addtocart.jpg"></a></td>
</tr>
<tr>
<td><imgsrc="images/m4.jpg"></td>
<td>
<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/Addtocart.jpg"></a></td>
</tr>
</table>
</body>
</html>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 15
O/P:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 16
EXPERIMENT -4
Create registration form with the following fields Name,Password ,Confirm password,

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>
0i</tr>

<tr>
<td>Day
<select id="day">
<option>1
<option>2
<option>3
<option>4
<option>5
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 17
<option>6
<option>7
<option>8
<option>9
<option>10
<option>11
<option>12
<option>13
<option>14
<option>15
<option>16
<option>17
<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

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 18
<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
<option>1996
<option>1997
<option>1998
<option>1999
<option>2000

</select></td>
</tr>

<tr>
<td>Gender</td>
<td><input type="radio" name="radbtn">Male &nbsp;&nbsp;<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>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 19
<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:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 20
EXPERIMENT-5
Write a Java Script to validate the following fields of the registration modify web page

appearance using CSS

Validation.html
<html>
<head>
<title>Registration</title>
<script src="valid.js">
</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>
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 21
</body>
</html>

Valid.js

function validate()
{
var c1=new RegExp("^[\\w]{6,}$");
var c2=new RegExp("^[\\w]{6,}$");
var c3=new RegExp("^[\\w]+@[\\w]+.com$");
var c4=new RegExp("^[\\d]{10}$");
var name=document.f.user.value;
varpwd=document.f.pwd.value;
var email=document.f.email.value;
var phone=document.f.phone.value;
var error="";
if(!name.
match(c1))
{ error+="should be min of 6 char\n" }

if(!pwd.match(c2))
{
error+="should be min of 6 char\n"
}

if(!email.match(c3))
{
error+="should be of format [email protected]\n"
}Procedure:

if(!phone.match(c4))
{
error+="should be of 10 digits"
}
if(error!="")
{
window.alert(error);
}
else {
window.alert("u entered valid information");
}
}

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 22
Out put:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 23
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
document.Create CSS, XSL do display XML data

Procedure:

< booksinfor.dtd >


<!ELEMENT books (book+)>
<!ELEMENT book (Title,Author,ISBN,Publisher,Edition,Price)>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Author (#PCDATA)>
<!ELEMENT ISBN (#PCDATA)>
<!ELEMENT Publisher (#PCDATA)>
<!ELEMENT Edition (#PCDATA)>
<!ELEMENT Price (#PCDATA)>

< week5.xml >


<?xml version="1.0"?>
<!DOCTYPE books SYSTEM "booksinfor.dtd">
<?xml:stylesheet type="text/xsl" href="bookinf.xsl"?>
<books>
<book>
<title>Web programming,building internet applications</title>
<author>ChrisBates</author>
<ISBN>0-07-049543-7</ISBN>
<publisher>Wiley Dreamtech</publisher>
<edition>2nd edition</edition>
<price>Rs.250</price>
</book>
<book>
<title>Computer Networks</title>
<author> Andrew S Tanebaum</author>
<ISBN>81-203-1165-5</ISBN>
<publisher>Pearson</publisher>
<edition>4nd edition</edition>
<price>Rs.350</price>
</book>
<book>
<title>Frontiers of Electronic commerce</title>
<author>Kalakata</author>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 24
<ISBN>978-81-265-1173-0</ISBN>
<publisher>Pearson</publisher>
<edition>1st edition</edition>
<price> Rs.350 </price>
</book>
<book>
<title>Java Programming with CORBA</title>
<author>G.Brose</author>
<ISBN>978-81-265-1173-0</ISBN>
<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>

< bookinf.xsl >


<?xml version="1.0"?>
<xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>d

<xsl:template match="/">
<html>
<body>
<table align="center" cellspacing="5" cellpadding="10">
<caption>BOOKS INFORMATION</caption>
<trbgcolor="light brown ">
<th>Title</th>
<th>Author</th>
<th>ISBN</th>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 25
<th>Publisher</th>
<th>Edition</th>
<th>Price</th>
</tr>
<xsl:for-each select="books/book">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="author"/></td>
<td><xsl:value-of select="ISBN"/></td>
<td><xsl:value-of select="publisher"/></td>
<td><xsl:value-of select="edition"/></td>
<td><xsl:value-of select="price"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Output:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 26
EXPERIMENT-7
Install XAMPP and JOOMLA or Word press and test

STEPS FOR INSTALLING XAMPP

1. In your web browser, go to https://www.apachefriends.org/index.html

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 27
2. Click on the download link for XAMPP.

3. When prompted for the download, click "Save" and wait for your download to finish.

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 28
4. Open CD or DVD drive from My Computer. Install the program, and click on "Run."

5.Accept 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
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 29
prompted on the command line. You can always change settings, by editing the configuration
files later.

6.When your installation is complete, exit the command window by typing x on the
command line.

7.Start the XAMPP Control Panel.


Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 30
8 .Start the Apache and MySQL components. You can also start the other components, if
you plan to use them.

9.Verify the Apache install, by clicking on the Apache administrative link in the Control Panel.

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 31
10.Verify 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

INSTALLING JOOMLA

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 32
Step-1: Select language

Step-2:Click on next button

Step-3:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 33
Step-4:Select a folder joomla

Step-5:Enter required fields

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 34
Step-6:Click on next button

Step-7:Enter site name


Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 35
Step-8:Enter existing mail id

Step-9: Enter required fields

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 36
Step-10:Click on next button

Step-11:Click on next button

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 37
Step-12:Installation is being processed

Step-13:Click on Finish button

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 38
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 39
INSTALLING WORDPRESS:

Step-1:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 40
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 41
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 42
Step-4.1

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 43
Step-4.2

Step-4.3

fs fffs f

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 44
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 45
EXPERIMENT-8
Write Servlet Program to read data submitted from Registration form and store into the

Mysql database

Procedure:
Reg.html:
<html>
<head>
<title> validation </title>
</head>
<body bgcolor="magenta">
<form action="Register.jsp" method="post">
<h1 align="center">REGISTRATION FORM</h1>
<table border="0">
<tr>
<td>Name:</td>
<td><input type="text" name="t1" min length="6"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="t2"></td>
</tr>
<tr>
<td>Phone number:</td>
<td><input type="text" name="t3"></td>
</tr>
<tr>
<td>E-mail id:</td>
<td><input type="text" name="t4"></td>
</tr>
<tr>
<td><input type="submit" value="submit"></td>
<td><input type="reset" value="cancel"></td>
</tr>
</table>
</form>
</body>
</html>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 46
Register.jsp:
<%@ page language="java" import="java.sql.*,javax.servlet.*" %>
<html>
<form>
<%
String v1,v2,v3,v4,str;
v1=request.getParameter("t1");
v2=request.getParameter("t2");
v3=request.getParameter("t3");
v4=request.getParameter("t4");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn=DriverManager.getConnection("jdbc:odbc:oradsn","system","ravindra");
Statement st=cn.createStatement();
st.executeUpdate("insert into register values('"+v1+"','"+v2+"',"+v3+",'"+v4+"')");
if(cn!=null)
{
%>
</form>
Registration Successful
<%
}
else
{
out.println("Registration failed");
}
st.close();
cn.close();
}catch(Exception e) { out.println(" Registration failed");
%>
<P><a href = "reg.html" target =f2 ><B> Back<B></a>
<%
}
%>
</body></html>
Execution:
Create a table with name register with name (varchar2 (10)), password (varchar2 (10)),
Phone(number (10)) ,Email-ID (varchar2(10)).
Create the Data source name.
Start->settings->control panel->Administrative Tools->Data Sources.
Under SystemDSN add Microsoft ODBC for Oracle.
Set Data Source name to oradsn.

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 47
Output:1

Output:2

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 48
EXPERIMENT-9
Write a 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:

Login.html:
<html>
<head>
<title> login page </title>
</head>
<body bgcolor="cyan"><center>
<right>
<form action="valid.jsp" 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>
Valid.jsp:
<%@ page language="java" import="java.sql.*,javax.servlet.*" %>
<html>
<form>
<%
int v=0;
String v1,v2,v3,v4,str;
v1=request.getParameter("t1");
v2=request.getParameter("t2");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn=DriverManager.getConnection("jdbc:odbc:oradsn","scott","tiger");
Statement st=cn.createStatement();
ResultSetrs=st.executeQuery("select * from register");

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 49
while(rs.next())
{
if(rs.getString(1)==v1 &&rs.getString(2)==v2)
{
v=1;
}
}
if(cn!=null && v==1)
{
%>
</form>
Login Successfull
<%
}
else
{
out.println("Login failed");
}
st.close();
cn.close();
}catch(Exception e) { out.println("Error Occured. \n Login failed");
%>
<P><a href = "login.html" target =f2 ><B> Back<B></a>
<%
}
%>
</body></html>

Output:

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 50
Prepared By: MR.G.SREENIVASULU
MR.B.SRIKANTH Page 51
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="cookieex.php" method="get">

userid: <input type="text" name="t1"/><br>

password: <input type="password" name="p1"/><br/>

<input type="submit" value="submit"/>

</form>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 52
</body>

</html>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 53
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="Sessionex.php"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>

SESSIONEX.PHP

<?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";
?>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 54
EXPERIMENT-12
Using PHP and MySQL,develop a program to accept book information
viz.accessionnumber,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:

REG.HTML

<html>

<body>

<form action=”display.php”>

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>

DISLAY.PHP

<?php

$_user=$_get[“user name”];

$pwd=$_get[“user pass”];

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 55
$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());

echo”<center>registration detailsare”;

echo”<table border=1>”;

while($row=mysql_fetch_array($retval,MYSQL_ASSOC))

echo”<tr><td>{$row[‘user email’]}</td><td>”;

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 56
echo”{$row[‘useremail’]}</td><td>”;

echo”{$row[‘usercountry’]}</td></tr>”;

echo”</table></center>”;

mysql_close($conn);

?>

Prepared By: MR.G.SREENIVASULU


MR.B.SRIKANTH Page 57

You might also like