Web Technology Lab
Web Technology Lab
Web Technology Lab
Create a projectfolder and save all the following html files in the projectfolder. Create
another imagesfolder inside the projectfolder and copy the required images into the
imagesfolder.
index.html
<!DOCTYPE html>
<html>
<head>
<title>Online Book Store</title>
</head>
<frameset rows="20%,6%,*">
<frame name="f1" src="title.html" scrolling="no" noresize/>
<frameset cols="20%,20%,20%,20%,20%" scrolling="no" noresize>
<frame name="f21" src="home.html" />
<frame name="f22" src="login.html" />
<frame name="f23" src="registration.html" />
<frame name="f24" src="catalogue.html" />
<frame name="f25" src="cart.html" />
</frameset>
<frameset cols="20%,*" noresize>
<frame name="f31" src="course.html" scrolling="no" />
<frame name="f32" src="homepage.html" scrolling="auto" />
</frameset>
</frameset>
</html>
title.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><img src="images/logo.jpg" align="middle" height="135" />
<font
color="purple" size="12">ONLINE BOOK STORE</font></center>
</body>
</html>
home.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><a href="homepage.html" target="f32">Home</a></center>
</body>
</html>
login.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><a href="loginpage.html" target="f32">Login</a></center>
</body>
</html>
registration.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><a href="regpage.html" target="f32">Registration</a></center>
</body>
</html>
catalogue.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><a href="catpage.html" target="f32">Catalogue</a></center>
</body>
</html>
cart.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><a href="cartpage.html" target="f32">Cart</a></center>
</body>
</html>
homepage.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<b>Welcome to Online Book Store</b>
<p> Here you find all types of books, magazines and national and international
journals.</p>
</body>
</html>
loginpage.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 align="center">LOGIN</h1>
<form method="post">
<table align="center" cellspacing="10">
<tr>
<td><b>User ID</b></td>
<td><input name="uid" type="text"></td>
</tr>
<tr>
<td><b>Password</b></td>
<td><input name="pwd" type="password"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="Login">
<input type="reset">
</td>
</tr>
<tr>
<td colspan="2" align="right"><i><a href="regpage.html">New User Click
Here</a></i></td>
</tr>
</table>
</form>
</body> </html>
regpage.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<h1 align="center"> REGISTRATION </h1>
<table align="center" cellspacing="10">
<tr>
<td>Name::</td>
<td> <input name="uname" type="text"> </td>
</tr>
<tr>
<td>Password::</td>
<td> <input name="pwd" type="password"> </td>
</tr>
<tr>
<td> E-mail ID:: </td>
<td> <input name="email" type="text"> </td>
</tr>
<tr>
<td> Phone Number:: </td>
<td> <input name="phno" type="text" maxlength="10"> </td>
</tr>
<tr>
<td> Gender:: </td>
<td><input name="gender" type="radio"
value="Male"> Male
<input name="gender" type="radio" value="Female"> Female</td>
</tr>
<tr>
<td> Date of Birth </td>
<td>
<select name="date">
<option>--Date--</option>
<option>01</option><option>02</option><option>03</option><option>04</option><o
ption>05</option><option>06</option><option>07</option><option>08</option><opti
on>09</option><option>10</option><option>11</option><option>12</option><option
>13</option><option>14</option><option>15</option><option>16</option><option>1
7</option><option>18</option><option>19</option><option>20</option><option>21</
option><option>22</option><option>23</option><option>24</option><option>25</opt
ion><option>26</option><option>27</option><option>28</option><option>29</option
><option>30</option><option>31</option>
</select>
<select name="month">
<option>--MONTH--</option>
<option>JAN</option><option>FEB</option><option>MAR</option><option>APR</o
ption><option>MAY</option><option>JUN</option><option>JUL</option><option>A
UG</option><option>SEP</option><option>OCT</option><option>NOV</option><op
tion>DEC</option>
</select>
<select name="year">
<option>--YEAR--</option>
<option>1980</option><option>1981</option><option>1982</option><option>1983</o
ption><option>1984</option><option>1985</option><option>1986</option><option>1
987</option><option>1988</option><option>1989</option><option>1990</option><op
tion>1991</option><option>1992</option><option>1993</option><option>1994</optio
n><option>1995</option><option>1996</option><option>1997</option><option>1998
</option><option>1999</option>
<option>2000</option>
</select>
</td>
</tr>
<tr>
<td valign="top">Languages Known::</td>
<td>
<input name="lk" type="checkbox" value="English"> English<br>
<input name="lk" type="checkbox" value="Telugu"> Telugu<br>
catpage.html
<html>
<head>
</head>
<body>
<form>
<table cellspacing="10">
<tr>
<td><img src="images/html5.jpg" width="100" height="100"></td>
<td> Title : HTML5 and CSS3 <br>
Author : Sasha Vodnik <br> </td>
<td>Rs. 700 /- </td>
<td><input type="image" src="images/add to cart.jpg" width="150" height="100"></td>
</tr>
<tr>
<td><img src="images/php.jpg" width="100" height="100"></td>
<td> Title : PHP and MYSQL <br>
Author : W. Jason Gilmore <br> </td>
<td>Rs. 650 /- </td>
<td><input type="image" src="images/add to cart.jpg" width="150" height="100"></td>
</tr>
<tr>
<td><img src="images/j2ee.jpg" width="100" height="100"></td>
<td> Title : The Complete Reference JAVA 2 <br>
Author : Herbert Schildt <br> </td>
<td>Rs. 850 /- </td>
<td><input type="image" src="images/add to cart.jpg" width="150" height="100"></td>
</tr>
</table>
</form>
</body>
</html>
course.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<ul>
<li>B.Tech.</li>
<li>M.Tech.</li>
<li>MBA</li>
<li>MCA</li>
<li>Polytechnic</li>
</ul>
</body>
</html>
cartpage.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<h1 align="center">Shopping Cart</h1>
<form>
<table align="center" cellpadding="20px">
<tr>
<th>Product</th>
<th>Description</th>
<th>Price</th>
<th>Quantity</th>
<th>Subtotal</th>
</tr>
<tr>
<td><img src="images/html5.jpg" width="100" height="100" /></td>
<td>Title : HTML5 and CSS3 <br>Author : Sasha Vodnik</td>
<td>Rs. 700 /-</td>
<td><input type="text" size="2" value="1" readonly /></td>
<td>Rs. 700 /-</td>
</tr>
<tr>
<td><img src="images/php.jpg" width="100" height="100" /></td>
<td>Title : PHP and MYSQL <br>Author : W. Jason Gilmore </td>
<td>Rs. 650 /- </td>
<td><input type="text" size="2" value="1" readonly /></td>
<td>Rs. 650 /- </td>
</tr>
<tr>
<th colspan="2">Promotion Code</td>
<th colspan="3">Cart Totals</td>
</tr>
<tr>
<td colspan="2"><input type="text" placeholder="Coupon code" /> <input
type="button" value="Apply Coupon" /></td>
<th colspan="2">Subtotal</th>
<td>Rs. 1350 /-</td>
</tr>
<tr>
<td colspan="2"></td>
<th colspan="2">Total</th>
<th>Rs. 1350 /-</th>
</tr>
<tr>
<td colspan="5" align="right"><input type="button" value="Proceed to Checkout"
/></td>
</tr>
</table>
</form>
</body>
</html>
PaymentGateway.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Payment Gateway</title>
</head>
<body>
<h1 align="center">Credit Card Payment Gateway</h1>
<hr>
<form>
<table align="center" cellpadding="20px">
<tr>
<td colspan="2" align="center"><h2>Payment Details</h2></td>
</tr>
<tr>
<td colspan="2">
<b>CARD NUMBER</b><br>
<input type="text" placeholder="Valid Card Number" size="52" />
</td>
</tr>
<tr>
<td><b>Expire Date</b><br><input type="text" placeholder="MM/YY" /></td>
<td><b>CV Code</b><br><input type="text" placeholder="CVV" /></td>
</tr>
<tr>
<td colspan="2">
<b>CARD OWNER</b><br>
<input type="text" placeholder="Card Owner Name" size="52" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="Confirm Payment">
</td>
</tr>
</table>
</form>
</body>
</html>
/* Here, we create a backspace() function to remove the number at the end of the numeric
series in textview. */
function backspace()
{
var exp = document.form1.textview.value;
document.form1.textview.value = exp.substring(0, exp.length - 1); /* remove the element
from total length ? 1 */
}
</script>
*{
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<h1> Calculator Program in JavaScript </h1>
<div class= "formstyle">
<form name = "form1">
<input class= "textview" name = "textview">
</form>
<center>
<table >
<tr>
<td> <input class = "btn" type = "button" value = "C" onclick =
"form1.textview.value = ' ' " > </td>
<td> <input class = "btn" type = "button" value = "B" onclick = "backspace()" >
</td>
<td> <input class = "btn" type = "button" value = "/" onclick = "insert('/')" > </td>
<td> <input class = "btn" type = "button" value = "x" onclick = "insert('*')" >
</td>
</tr>
<tr>
<td> <input class = "btn" type = "button" value = "7" onclick = "insert(7)" > </td>
<td> <input class = "btn" type = "button" value = "8" onclick = "insert(8)" > </td>
<td> <input class = "btn" type = "button" value = "9" onclick = "insert(9)" > </td>
<td> <input class = "btn" type = "button" value = "-" onclick = "insert('-')" > </td>
</tr>
<tr>
<td> <input class = "btn" type = "button" value = "4" onclick = "insert(4)" > </td>
<td> <input class = "btn" type = "button" value = "5" onclick = "insert(5)" > </td>
<td> <input class = "btn" type = "button" value = "6" onclick = "insert(6)" > </td>
<td> <input class = "btn" type = "button" value = "+" onclick = "insert('+')" >
</td>
</tr>
<tr>
<td> <input class = "btn" type = "button" value = "1" onclick = "insert(1)" > </td>
<td> <input class = "btn" type = "button" value = "2" onclick = "insert(2)" > </td>
<td> <input class = "btn" type = "button" value = "3" onclick = "insert(3)" > </td>
<td rowspan = 5> <input class = "btn" style = "height: 110px" type = "button"
value = "=" onclick = "equal()"> </td>
</tr>
<tr>
<td colspan = 2> <input class = "btn" style = "width: 106px" type = "button" value
= "0" onclick = "insert(0)" > </td>
<td> <input class = "btn" type = "button" value = "." onclick = "insert('.')"> </td>
</tr>
</table>
</center>
</div>
</body>
</html>
Out Put of the Program
UNIT- 03 Write a PHP program to display a digital clock which display the
current time of the server.
Program Output
<head>
<meta http-equiv="refresh"
content="1"/>
<style>
p{
color:yellow;
font-size:90px;
position:absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -
50%);
}
body {
background-color:maroon;
}
</style>
<p> <?php echo date(" h: i : s
A");?> </p>
</head>
UNIT- 04 Write an HTML code to display your CV on a web page.
<html>
<head><title>My RESUME </title></head>
<body bgcolor="white">
<table align="center" border="2" cellspacing="5" cellpadding="5" >
<td>
<h1 align= center><b> YOUR NAME HERE</b></h1>
<address style="color:red;" align= center> [email protected] <br>
+91-1122334455 </address>
<h2 style="color:blue;">CAREER OBJECTIVE:</h2>
Want to be the part of a software developer organization and utilize my knowledge,Skills
and expertise to contribute<br> towards organization and professional
brilliance and to learn more with the passage of time from all<br>
types of situations and circumstances.
<h2 style="color:blue;">EDUCATION AND QUALIFICATIONS:</h2>
<table border="2" cellspacing="5" cellpadding="5" >
<tr>
<th>Qualification</th>
<th>Maximun Marks</th>
<th>Obtained Marks</th>
<th>Division</th>
<th>Institution</th>
<th>Bord/University</th>
</tr
<tr>
<td>DIPLOMA IN PROGRESS</td>
<td>-----</td>
<td>-----</td>
<td>None</td>
<td>G.P,SITAMARHI</td>
<td>STATE BOARD </td>
</tr>
<tr>
<td>INTERMEDIATE</td>
<td>500</td>
<td>420</td>
<td>FIRST</td>
<td>S.D.S COLLEGE </td>
<td>BSEB </td>
</tr>
<tr>
<td>ITI</td>
<td>1100</td>
<td>661</td>
<td>FIRST</td>
<td>BIHAR ITI </td>
<td>STATE BOARD </td>
</tr>
<tr>
<td>MATRIC</td>
<td>500</td>
<td>353</td>
<td>FIRST</td>
<td>RAHUL H/S BALIA</td>
<td>BESB</td>
</tr>
</table>
<h2 style="color:blue;">TECHNICAL EXPERIENCE:</h2>
If we want to apply the same style declaration to different elements every time.
Inline style sheet mixes the content with the presentation. So, if you want to avoid this
mixing up, don't use Inline style sheet.
Example: Demonstration of inline style sheet
<html>
<head>
<title> Inline CSS</title>
<meta http-equiv="content-style-type" content="text/css">
</head>
<body style="background:orange">
<h1 style="color:White; font-family:arial; font-size:14pt; text-transform:uppercase;
text-align:left;"> This is an example of inline css</h1>
</body>
</html>
Output:
The style specifications are defined within the head section of the web page or HTML
page.
In this style sheet type, the alternate method of attaching a style sheet to HTML
document is <STYLE> tag.
While using <STYLE> tag it must include TYPE attribute.
TYPE attribute specifies what type of style is included in the document.
The attributes of <STYLE> element tag are:
1. type
<!DOCTYPE html>
<html>
<head>
<title> Embedded CSS</title>
<style type="text/CSS">
body {
background-color:#ccffff;
}
h1 { color: purple; font-family: arial; font-size: 30 px; text-transform:
uppercase; text-align: left;}
</style>
</head>
<body>
<h1> This is an example of embedded CSS</h1>
<h1> B E </h1>
</body>
</html>
Output:
<!DOCTYPE html>
<html>
<head>
<title> Embedded CSS</title>
<style type="text/CSS">
body {
background-color:#ccffff;
}
h1 { color: purple; font-family: arial; font-size: 30 px; text-transform:
uppercase; text-align: left;}
</style>
</head>
<body>
<h1>Computer programming languages</h1>
<table border="1">
<tr>
<th>Web-tech</th>
<th>Object-Oriented</th>
</tr>
<tr>
<td>CSS</td>
<td>java</td>
</tr>
</table>
<p>Embedded CSS is better than Inline CSS</p>
</body>
</html>
Output:
In external style sheets, the CSS files are kept separately from an HTML document.
External CSS file contains only CSS code and it is saved with a “.css” extension.
The CSS file is used as an external style sheet file in HTML document by using a
<LINK> tag instead of <STYLE> tag.
The <LINK> tag is placed in the <HEAD> section of the HTML document.
The main advantage of External style sheet is that external CSS is a “true separation” of
style and content.
It is easier to reuse CSS code in any separate file.
Syntax:
<HEAD> <LINK REL=“stylesheet” TYPE=“text/css” HREF=“mystyle.css”>
</HEAD>
1. rel
It is optional.
It indicates the name of the style sheet.
5. media
body { background:#ccffff;}
h2,p {
color: green;
font-family:arial;
text-align:center;
}
p i{
color: orange;
border-style: solid;
font-weight: lighter;
}
.ex{color:purple}
NOTE: Save following program as external.html and link above CSS file in it.
<html>
<head><title>Extenal style sheet</title>
<link rel= "stylesheet" type= "text/CSS" href="external.css">
</head>
<body>
<h2> It is an example of External style sheet</h2>
<p class="ex"> This is a "true separation" of style and content</p>
<p><i> External CSS </i> </p>
</body>
</html>
Output:
NOTE: To run the program, save the above .css and .html files on the same location or
folder.
Write a JavaScript that calculates the squares and cubes of the
UNIT- 07 numbers from 0 to 10 and outputs HTML text that displays the
resulting values in an HTML table format
# Program For calculates the squares and cubes of the numbers from 0 to 10.
<!DOCTYPE HTML>
<html>
<head> <style>
table,tr,
td
{
border: solid black;
width: 33%;
text-align: center;
border-collapse: collapse;
background-color:lightblue;
}
table { margin: auto;
} </style>
<script>
document.write( "<table><tr><th colspan='3'> NUMBERS FROM 0 TO 10 WITH
THEIR QUARES AND CUBES </th></tr>" );
document.write( "<tr><td>Number</td><td>Square</td><td>Cube</td></tr>" );
for(var n=0; n<=10; n++)
{
document.write( "<tr><td>" + n + "</td><td>" + n*n + "</td><td>"+ n*n*n +
"</td></tr>" ) ;
}
document.write( "</table>" ) ;
</script>
</head>
</html>
Out of The Program
*****