Web Programming Lab Manual
Web Programming Lab Manual
Web Programming Lab Manual
AIM: Create a simple webpage using HTML5 Semantic and Structural Elements.
Procedure:-
Create an html page named as “Simple _html_tags.html”
Add the following tags detail.
1. Set the title of the page as “Simple HTML Tags”
2. Within the body perform the following
a) Moving text = “Simple HTML Tags”
b) Different heading tags ( h1 to h6)
c) Paragraph
d) Horizontal line
e) Line Break
f) Block Quote
g) Pre tag
h) Different Logical Style ( <b>, <c>, <sub>, <sup>….)
i) Different Physical style ( <code>, <del>, <kbd>…)
j) Listing tags ( 2 types with, & each type provide different “type” attribute)
Solution:-
In notepad type the necessary code & save with the file name mentioned with .html extension.
2
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>Roman numbers list:</h4>
<ol type="I">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>Lowercase Roman numbers list:</h4>
<ol type="i">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>Disc bullets list:</h4>
<ul type="disc">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ul>
<h4>Circle bullets list:</h4>
<ul type="circle">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ul>
<h4>Square bullets list:</h4>
<ul type="square">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ul>
<h4>A Definition List:</h4>
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
<hr>
3
Output:
4
EXPERIMENT 2
AIM: Create a webpage using HTML5 Media Elements.
Procedure:-
1. Create an html page named as “Table.html” to display your class time table.
a) Provide the title as Time Table.
b) Provide various color options to the cells ( High light the lab hours and elective hours
with different colors.).
2. Create an html page named as “image.html” to display image at various position & size.
3. Create an html page named as “video.html” to display the audio and video files.
4. Create an html page named as “pagelink.html” , in this convert the file created in the
Exercise1” to single page link by providing the links at the top as well as to the below
screen/page.
5. Create an html page named as “hyperlink.html” to link to the above four files. For image
link alone give a image to be displayed as a link.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
File Name:hyperlink.html
<html>
<body>
<a href=Pagelink.html>different Tags</a><br>
<br><a href=table.html>Time Table</a>
<br>
<br><a href=image.html><img src="web.gif"</a>
<br><a href=video.html>videos</a>
</body>
</html>
Output:
5
File Name:Table.html
<html>
<head>
<title>Time Table</title>
</head>
<body>
<B><center><h3>
S.R.M UNIVERSITY,<br>
DEPARTMENT OF INFORMATION TECHNOLOGY<br>
EFFECTIVE FROM: 04.01.09<br></center></b></h3>
<table border="2" width="75%" cellspacing="2" cellpadding="25"
align=center><h3>
<caption align=left>Class: III IT-
‘C’ &
nbsp; &nbp;
&nbs
p; &n
bsp; &
nbsp;
&nbs
p;
R.No:306</caption></h3>
<thead>
<tr>
<th >Periods</th>
<th ROWSPAN=2>1 <br>8.30-9.20</th>
<th ROWSPAN=2>2<br>9.20-10.10</th>
<th ROWSPAN=2>3<br>10.20-11.10</th>
<th ROWSPAN=2>4<br>11.10-12.00</th>
<th ROWSPAN=2>5<br>1.30-2.20</th>
<th ROWSPAN=2>6<br>2.20-3.10</th>
<th ROWSPAN=2>7<br>3.10-4.00</th>
</tr>
<tr><th> Days</th>
</thead>
<tbody>
<tr>
<th>Monday</th>
<td>IT0302</td>
<td>IT0306</td>
<td>IT0304</td>
<td>IT0306</td>
<td>IT0302</td>
<td COLSPAN=2><center>IT0324</td>
</tr>
<tr>
<th>TuesDay</th>
<td COLSPAN =4 bgcolor="cyan"><center>IT0320/IT0322</td>
<td>IT0310</td>
6
<td>IT0304</td>
<td>IT308</td>
</tr>
<tr>
<th>Wednesday</th>
<td COLSPAN =2 bgcolor="red"><center>ELETIVE - I</td>
<td>IT0306</td>
<td>IT310</td>
<td>IT304</td>
<td>IT308</td>
<td>COUN</td>
</tr>
<tr>
<th>Thursday</th>
<td>IT302</td>
<td>IT0304</td>
<td COLSPAN=2><center>PD0302</td>
<td COLSPAN=3 bgcolor="cyan"><center>IT0320/IT0322</td>
</tr>
<tr>
<th>Friday</th>
<td>IT0308</td>
<td>IT0306</td>
<td>IT0308</td>
<td>IT0302</td>
<td COLSPAN=2 bgcolor="red"><center>ELECTIVE - I</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
Output:
7
File Name:image.html
<html>
<body>
<img src="img_tree.png" />
<br>
<p>
<img src="hackanm.gif" align="left" width="48" height="48" />
A paragraph with an image. The align attribute of the image is set to "left". The image will
float to the left of this text.
</p>
<p>
<img src="hackanm.gif" align="right" width="175" height="175" />
A paragraph with an image. The align attribute of the image is set to "right". The image will
float to the right of this text.
</p>
</body>
</html>
Output:
8
File Name:video.html
<html>
<body><object width="560" height="340">
<param name="movie"
value="http://www.youtube.com/v/AGuniy5Ipc0&hl=en_US&fs=1&"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/AGuniy5Ipc0&hl=en_US&fs=1&"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="560" height="340"></embed>
</object>
<br>
</html>
</body>
Output:
9
<center><FONT COLOR="#0000FF"><a href="#block"> BLOCK QUOTE
Tags</a></FONT></center>
<center><FONT COLOR="#0000FF"><a href="#pre"> PRE
Tags</a></FONT></center>
<center><FONT COLOR="#0000FF"><a href="#logical"> Logical style</a>
</FONT></center>
<center><FONT COLOR="#0000FF"><a href="#physical"> Physical style</a>
</FONT></center>
<center><FONT COLOR="#0000FF"><a href="#List"> Listing Tags</a>
</FONT></center>
<a name="heading"></a>
<center><FONT COLOR="#0000FF"> Heading Tags</FONT></center>
<h1> Heading H1</h1>
<h2> Heading H1</h2>
<h3> Heading H1</h3>
<h4> Heading H1</h4>
<h5> Heading H1</h5>
<h6> Heading H1</h6>
<a href="#top">Top </a>
<center><FONT COLOR="#0000FF"> Text Elements</FONT></center>
<a name="text"></a>
<p>This is a praragrspg tag.
HTML 5
HTML 5 will eventually replace HTML 4.01, the dominant programming language currently
used to build web pages. But the governing bodies in charge of the web are still drafting the
details, and nobody expects HTML 5 to fully emerge as the new standard for at least a few
more years.
HTML 5 will be great step forward, standardizing things like dragging and dropping elements
on web pages, in-line editing of text and images on sites and new ways of drawing
animations. There's also support for audio and video playback without plug ins, a boon for
usability and a worrisome sign for Adobe's Flash, Microsoft's Silverlight and Apple's
QuickTime. The language will also give a boost to web apps, as there are new controls for
storing web data offline on your local machine. Want Gmail on your desktop? HTML 5
makes it possible. Alas, the blink tag isn't invited to the party
</p>
<a href="#top">top </a>
<hr>
<a name="line"></a>
<center><FONT COLOR="#0000FF"> Line break Tags</FONT></center>
This is a long piece of text consisting of three<BR>
sentences and shows you the functions of the<BR>
Line Break tag. This tag is used quite frequently<BR>
to add line breaks in the HTML code. It is also used<BR>
to add blank lines to a document.<BR>
<a href="#top">top </a>
<hr>
<a name="block"></a>
<center><FONT COLOR="#0000FF"> BLOCK QUOTE Tags</FONT></center>
<p>This is some text before the quotation.</p>
<blockquote>This is a long blockquote created with the <blockquote>
10
tag.</blockquote>
</blockquote>
<a href="#top">top </a>
<hr>
<a name="pre"></a>
<center><FONT COLOR="#0000FF"> PRE Tags</FONT></center>
<pre>
IT 206 JAVA
IT306 WEB SYSTEMS
IT322 WEB SYSTEMS LAB
</PRE>
<a href="#top">top </a>
<HR>
<a name="logical"></a>
<center><FONT COLOR="#0000FF"> Logical style </FONT></center>
This is <b>bold</b> This is bold<br>
This is <big>big font</big> This is big font<br>
This is <i>italic</i> This is italic<br>
Was <s>$50</s>; now $40 Was $50; now $40<br>
This is <small>small</small> This is small<br>
H<sub>2</sub>O H2O<br>
May 5<sup>th</sup> 2005 May 5th 2005<br>
<tt>fixed-width font</tt> fixed-width font<br>
This is <u>underlined</u> This is underlined<br>
<br>
<a href="#top">top </a>
<hr>
<a name="physical"></a>
<center><FONT COLOR="#0000FF"> Physical Style </FONT></center>
This is used for a short <cite>quote</cite>. This is used for a short quote.<br>
<code>y = m * x + b</code> y = m * x + b<br>
<del>Deleted</del> text Deleted text<br>
<dfn>definition</dfn> text definition text<br>
This is <em> emphasized </em>. This is emphasized<br> .
<ins>inserted</ins> text inserted text<br>
<kbd>code</kbd> sample code sample<br>
<samp>code</samp> sample code sample<br>
This is <strong>strong</strong>. This is strong.<br>
<var>program</var> variable program variable<br>
<br>
<a href="#top">top </a>
<hr>
<a name="list"></a>
<center><FONT COLOR="#0000FF"> Listing Tags</FONT></center>
<h4>Numbered list:</h4>
<ol>
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
11
</ol>
<h4>Letters list:</h4>
<ol type="A">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>Lowercase letters list:</h4>
<ol type="a">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>Roman numbers list:</h4>
<ol type="I">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>Lowercase Roman numbers list:</h4>
<ol type="i">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>Disc bullets list:</h4>
<ul type="disc">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ul>
<h4>Circle bullets list:</h4>
<ul type="circle">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ul>
<h4>Square bullets list:</h4>
<ul type="square">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ul>
12
<h4>A Definition List:</h4>
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
<hr>
<a href="#top">Top</a>
</html></body>
Output:
File Name:ex3.html
<html>
<body>
<a href="frames.html" target="two">navigation frame</a><br>
<a href="floatingframe.html" target="two">floating frame</a><br>
<a href="Noframe.html" target="two">no frame</a><br>
<a href="mixedframe.html" target="two">mixed frame</a><br>
</body>
</html>
File Name: Frames.html
<html>
<frameset cols="30%,*" scrolling="no" noresize>
<frame name="one" src="ex3.html"></frame>
13
<frame name="two" ></frame>
</frameset>
</html>
Output:
File Name:Navigationframes.html
<html>
<frameset cols="30%,*" scrolling="no" noresize>
<frame name="one" src="ex3.html"></frame>
<frame name="two" ></frame>
</frameset>
</html>
Output:
14
File Name: floatingframe.html
<html>
<body>
<p> Explanation: There is a problem with the page you are trying to reach and it cannot be
displayed.
Try the following:
* Refresh page: Search for the page again by clicking the Refresh button. The timeout may
have occurred due to Internet congestion.
* Check spelling: Check that you typed the Web page address correctly. The address may
have been mistyped.
* Access from a link: If there is a link to the page you are looking for, try accessing the page
from that link.
If you are still not able to view the requested page, try contacting you
<iframe src="htmlex1.html" height="50%" width="50%">
</iframe>
<embed src="video.avi" width="50%" height="50%" autostart="true">
</embed>
</body>
</html>
Output:
15
EXPERIMENT 3
AIM: Add a Cascading Style sheet for designing the web page.
Procedure :-
1. Create a external style sheet named as “external_css.css” and provide some styles for h2,
hr, p & a tags.
2. Create an html file named as “Style_sheet.html”
a) Include the external style sheet with necessary tag.
b) Include the internal style sheet for body tags & also use class name, so that the style can be
applied for all tags.
c) include a <p> tags with inline style sheet.
Solution :-
1. Create a css file in a notepad & save it with the .css extension.
2. In notepad type the necessary code & save with the file name mentioned with .html
extension.
16
yet. But, we will explain these methods in a later chapter in the tutorial.</p>
</div>
</div>
<p style="border-style:dotted solid dashed double">This is some text in a paragraph.</p>
<p style="border-style:dotted solid dashed">This is some text in a paragraph.</p>
<p style="border-style:dotted solid">This is some text in a paragraph.</p>
<p style="border-style:dotted">This is some text in a paragraph.</p>
<h2>This is a header 1</h2>
<hr />
<p>You can see that the style sheet formats the text</p>
<p><a href="cd_catalog.xml" target="_blank">This is a link</a></p>
</body>
</html>
File Name: external_style.css
<style>
h2 {color:maroon; font-size:20pt}
hr {color:navy}
p {font-size:11pt; margin-left: 15px}
a:link {color:green}
a:visited {color:yellow}
a:hover {color:black}
a:active {color:blue}
</style>
Output:
17
EXPERIMENT 4 (a)
AIM: Design a dynamic web page with validation using JavaScript.
Procedure :
Create an html page named as “Sorting.html”
1. Within the script tag
a) define a function called as “array_size()” to get the size of array.
b) define a function called as “get_number()” to get numbers from user.
c) define a function called as “Sorting()” to sort the numbers.
2. within the body tag
Display the message to click the button & display a button to cll the “array_size()” method.
“array_size()” method calls “get_number()” method which in turn calls the “sorting()”
method.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
File Name: Sorting.html
<html>
<head>
<script type="text/javascript">
var num=0;
number=0;
var numarray=new Array();
function array_size()
{
num=prompt("Enter how many number to be sorted","000");
number=parseInt(num);
get_numbers();
}
function get_numbers()
{
if (number!=null && number!="")
{
for( i=0;i<number;i++)
{
n=prompt("Enter the number to be sorted","1");
numarray[i]=parseInt(n);
}
}
sorting()
}
function sorting()
{
document.writeln("<h1>Sorted Array<h1>");
document.writeln(numarray.sort(sortNumber));
}
function sortNumber(a,b )
{
return a - b;
18
}
</script>
</head>
<body>
<h1> Click the button to get the Number sorted</h1>
<input type="button" onclick="array_size()" value="Get Array Size" />
</body>
</html>
Output:
19
EXPERIMENT 4 (b)
AIM: To create an html page to explain the use of various predefined functions in
a string and math object in java script.
Procedure :
Create an html page named as “String_Math.html” and within the script tag define some string
variables and use different string function to demonstrate the use of the predefined functions.
Do the same for the Math function.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
20
document.write("<br>round 10.5 is=="+Math.round(10.5));
document.write("<br>maximum among 10,5,7 is=="+Math.max(10,5,7));
document.write("<br>minimum of 10,5,7 is=="+Math.min(10,5,7));
document.write("<br>power is=="+Math.pow(2,5));
document.write("<br>square root=="+Math.sqrt(16));
document.write("<br>absolute of -10=="+Math.abs(-10));
for(i=0;i<10;i++)
{document.write("<br>random"+i+"=="+Math.random());}
document.write("<br>"+parseInt(5.6));
document.write("<br>=="+isNaN(a));
</script>
</body>
</html>
Output:
21
EXPERIMENT 4 (c)
AIM: To create an html page to explain the use of various predefined functions in
a array & Date object in Javascript.
Procedure: Create an html page named as “date.html” & “array.html”. within the script tag
define the various date object and array object functions & display the output.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
22
document.write("<br><b style=\"color:purple;\">getHours() Method in
date3==</b>"+date3.getHours());
document.write("<br><b style=\"color:purple;\">getMilliseconds() Method in
date2==</b>"+date2.getMilliseconds());
document.write("<br><b style=\"color:purple;\">getMilliseconds() Method in
date22==</b>"+date22.getMilliseconds());
document.write("<br><b style=\"color:purple;\">getMilliseconds() Method in
date3==</b>"+date3.getMilliseconds());
document.write("<br><b style=\"color:purple;\">getMinutes() Method in
date3==</b>"+date3.getMinutes());
document.write("<br><b style=\"color:purple;\">getSeconds() Method in
date3==</b>"+date3.getSeconds());
document.write("<br><b style=\"color:purple;\">getMonth() Method in
date4==</b>"+date4.getMonth());
document.write("<br><b style=\"color:purple;\">getTime() Method in
date33==</b>"+date33.getTime());
document.write("<br><b style=\"color:purple;\">getTime() Method in
date333==</b>"+date333.getTime());
document.write("<br><b style=\"color:purple;\">getTime() Method in
date4==</b>"+date4.getTime());
document.write("<br><b style=\"color:purple;\">getTime() Method in
date1==</b>"+date1.getTime());
document.write("<h2 style=\"color:purple;\">Date Methods for Setting values</h2>");
date1.setDate(23);
document.write("<br><b style=\"color:purple;\">setDate() Method in date1==</b>"+date1);
date1.setFullYear(2012)
document.write("<br><b style=\"color:purple;\">setFullYear() Method in
date1==</b>"+date1);
</script>
</head>
</html>
Output:
23
File Name: Array.html
<html>
<head>
<title>Array program</title>
</head>
<body>
<script language"javascript">
var days=["Monday","Tuesday","Wednesday","Thursday","Friday"];
var day=new Array("Mon","tues","Wed","Thrus","fri");
var mixed=["monday",34,13.78,"tuesday"];
var mix=new Array("mon",1,12.1,"tues");
document.write("<br><h3>Printing/Accessing the values in array using LOOP</h3>");
for(i=0;i<mixed.length;i++)
{
document.write("<br>Array element "+i+" == "+mixed[i]);
}
document.write("<br><h3>Enhanced array </h3>");
mixed[4]="Wednesday";
mixed[10]="Friday";
for(i=0;i<mixed.length;i++)
{
document.write("<br>Array element "+i+" == "+mixed[i]);
}
document.write("<br><h3>Searching an Element in an array </h3>");
for(i=0;i<mixed.length;i++)
{
if(mixed[i]==34)
{
document.write("<br>Array element "+i+" == "+mixed[i]+" is found");
break;
}
}
document.write("<br><h3>Removing an Element from an array </h3>");
var remove=prompt("Enter an element that to be removed from array");
var temp=new Array(mixed.length-1);
var count=0;
for(i=0;i<mixed.length;i++)
{
if(mixed[i]!=remove)
{
temp[count]=mixed[i];
count++;
}
}
mixed=temp;
document.write("<br><h3>New Array element after removing</h3>");
for(i=0;i<mixed.length;i++)
{
document.write("<br>Element "+i+" == "+mixed[i]);
}
24
document.write("<br><h3>OBJECT BASED ARRAY FUNCTION</h3>");
document.write("<br><b>Concatenation</b>");
var newarray=days.concat(day,mix);
for(i=0;i<newarray.length;i++)
{
document.write("<br>Element "+i+" == "+newarray[i]);
}
document.write("<br><br><b>Joining with some string</b>");
document.write("<br>"+mix.join("-"));
document.write("<br><br><b>POPing one element from array</b>");
document.write("<br>"+mix.pop());
document.write("<br>Array after pop is");
document.write("<br>"+mix.join("-"));
document.write("<br><br><b>PUSHing one or more element into an array</b>");
mix.push(10,"suba",234.8);
document.write("<br>Array after push is");
document.write("<br>"+mix.join("-"));
document.write("<br><br><b>Reversing an array</b>");
document.write("<br>Array after reverse is");
document.write("<br>"+mix.reverse());
document.write("<br><br><b>Shifting in an array</b>");
document.write("<br>Array after shifting one element is");
document.write("<br>"+mix.shift());
document.write("<br>New mix array is =="+mix.join("-"));
document.write("<br><br><b>UNShifting in an array</b>");
document.write("<br>Array after unshifting one element is");
day.unshift("suba","satheesh");
document.write("<br>New day array is =="+day.join("-"));
document.write("<br><b>Extracting a part of array</b>");
document.write("<br>"+mixed.slice(3));
document.write("<br>"+mixed.slice(4,11));
document.write("<br><b>Sorting an array</b>");
document.write("<br>"+days.sort());
var num=[1,4,2,3,11,33,3.4,99];
document.write("<br><b>Sorting an number array</b>");
//document.write("<br>"+num.sort(function(a,b){return a-b;}));
document.write("<br>"+num.sort(nr));
function nr(a,b)
{
return a-b;
}
document.write("<br><br><b>Splice-removing and adding element in an array at the same
time</b>");
day.splice(2,2,"Kaushik","Kaushika","Akshitha");
document.write("<br>New day array is =="+day.join("--"));
var str="123+5";
x=20;
document.write("<br><br><b>Eval function :--</b></br>");
document.write("<br>Value of str =="+eval(str)+"<br>");
document.write("<br />" + eval(x+17));
25
eval("x=10;y=20;document.write(\"<br>x*y == \"+x*y)");
document.write("<br><h3>Global functions</h3>");
document.write("<ol><li>escape()<li>eval()<li>isFinite()<li>isNaN()");
document.write("<li>Number()<li>parseFloat()<li>parseInt()<li>String()</ol>");
</script>
</body>
</html>
Output:
Procedure:
Create an html page named as “exception.html” and do the following.
1. within the script tag write code to handle exception
a) define a method RunTest() to get any string values(str) from the user and cll the method
Areletters(str).
b) In Areletters(str) method check whether str contain only alphabets (a-z, AZ), if not throw
exception.
c) Define a exception method Input Exception(str) to handle the exception thrown by the
above method.
2. Within the body tag define a script tag to call Runtest() method defined.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
27
RunTest();
</script>
</body>
</html>
Output
28
EXPERIMENT 4 (e)
AIM: To display the calendar using javascript code by getting the year from the
user.
Procedure:
Create an html page named as “calendar.html”
1. Define a method called “day_title(days)” to fill the days in the table.
2. Define a method called “fill_table(month,len)” to fill the table with date, according to the
month & number of dates (len).
3. Define a prompt() method to get the year from the user.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
29
day++
}
document.write("<tr>")
start_day=i;
}
document.write("</tr></table><br>")
}
year=prompt("enter 4 digit year ");
today=new Date("January 1, "+year)
start_day=today.getDay()+1
fill_table("January", 31)
if (year%4==0)
fill_table("February", 29)
else
fill_table("February", 28)
fill_table("March", 31)
fill_table("April", 30)
fill_table("May", 31)
fill_table("June", 30)
fill_table("July", 31)
fill_table("August", 31)
fill_table("September", 30)
fill_table("October", 31)
fill_table("November", 30)
fill_table("December", 31)
</script>
</head>
</html>
Output:
30
EXPERIMENT 4 (f)
AIM: To create a html registration form and to validate the form using javascript
code.
Procedure:
Create an html page named as “validate_registration.html”
1. Define a method name as “reset()” to be called when reset button is clicked and manually
set all values of fields to default.
2. Define a method name as “check()” to be called when check button is clicked.
a) here check for blank entry, name, age, email, phone no, radio button, checkbox.
b) Once all the valuables are properly filled make the submit button to be visible.
3. Define the various fields in form using table.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
31
alert("please enter the age correctly")
document.form1.t2.value=""
document.form1.t2.focus()
}
else if(document.form1.t2.value>40)
{
alert("Sorry you age is beyound the limit")
document.form1.t2.value=""
document.form1.t2.focus()
}
else if(document.form1.ta.value=="")
{
alert("please enter the address")
document.form1.ta.focus()
}
else
if((document.form1.r1[0].checked==false)&&(document.form1.r1[1].checked==false))
{
alert("please select the radio button")
document.form1.r1[0].focus()
}
else
if((document.form1.c1.checked==false)&&(document.form1.c2.checked==false)&&(docume
nt.form1.c3.checked==false)&&(document.form1.c4.checked==false)&&(document.form1.c5
.checked==false))
{
alert("please select the the languages known")
document.form1.c1.focus()
}
else if(document.form1.t3.value=="")
{
alert("please enter the password")
document.form1.t3.focus()
}
else
if((document.form1.t1.value!="")&&(document.form1.t2.value!="")&&(document.form1.t3.
value!="")&&(document.form1.ta.value!="")&&((document.form1.r1[0].checked!=false)||
(document.form1.r1[0].checked!=false))&&((document.form1.c1.checked!=false)||(document.
form1.c2.checked!=false)||(document.form1.c3.checked!=false)||(document.form1.c4.checked
!=false)||(document.form1.c5.checked!=false)))
{
x=confirm("you have entered the datas correctly,want to submit the form")
if(x)
{document.lay.visibility="show"}
}
}
</script>
<body bgcolor="lightblue" text="red" style="font-size:15pt;fontfamily:Garamond"
onload=document.form1.t1.focus()><center>
<h2>ENTRY FORM</h2></center>
32
<form name=form1 method=post >
<table name=tab cellspacing=30pt>
<tr><td align=left><h2>Enter your Name :</h2></td><td align=right>
<input type=text name=t1 size=18>
<tr><td align=left><h2>Enter your Age :</h2></td><td align=right>
<input type=text name=t2 maxlength=3 size=18>
<tr><td align=left><h2>Enter your Address :</h2></td><td align=right>
<textarea name=ta rows=5 cols=15></textarea>
<tr><td align=left><h2>Sex :</h2></td><td align=left>
<input type=radio name=r1 value="female">Female<br>
<input type=radio name=r1 value=male>Male</td>
<tr><td align=left><h2>Languages Known :</h2></td><td
align=left><center>(select more than one)</center>
<input type=checkbox name=c1 value=c>C<br>
<input type=checkbox name=c2 value=c++>C++<br>
<input type=checkbox name=c3 value=vb>VB<br>
<input type=checkbox name=c4 value=java>JAVA<br>
<input type=checkbox name=c5 value=asp>ASP<br>
<input type=checkbox name=c6 value=others>OTHERS<br></td>
<tr><td align=left><h2>Enter your Password :</h2></td><td align=right>
<input type=password name=t3 size=18>
</table><center>
<input type=button value=" reset " onClick=reset1()>
<input type=button value=" check " onClick=check()>
<h3>Before submitting the datas please click the check Button</h3>
<input type="submit" value=" submit "></center>
</form>
</body>
</html>
Output
33
EXPERIMENT 4 (g)
AIM: To create a html file. To open new window from the current window using
javascript code.
Procedure:
1. Create a html page named as openwindow.html.
2. Define a method called as openwin() which is to be called when a button is clicked. Within
this method specify the necessary code to open a new window with some message as well as
images.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
Output:
34
EXPERIMENT 4 (h)
AIM: To create an html page to change the background color for every click of a
button using javascript code.
Procedure:
1. Create a html page named as changebackground_color.html
2. Define a method named as random_color() which is to be called when you click on the
body. This method should generate random number, which is used to set the background
color.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
File Name:ChangeBackground_color.html
<html>
<head>
<script type="text/javascript">
function get_random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 15)];
}
document.body.style.background= color;
}
</script>
</head>
<body onclick="get_random_color()">
<b>Click me to change my color!</b>
</body>
</html>
Output
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
36
cnt++;
}
else
{
document.write("<td><a href=\"diary.html\"target=\"new\">"+j+"</a></td>");
cnt++;
}
}
document.write("</tr></table>");
}
</script>
</head>
<body bgcolor="green">
<form name="form1">
<select name="qual">
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option></option>
</select>
<select name="qual1">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option></option>
</select>
<input type="button" value="ok" onclick=my()></input></form>
</body>
</html>
Output
37
EXPERIMENT 4 (j)
AIM: To create a html page to display a new image & text when the mouse comes
over the existing content in the page.
Procedure:
1. Create an html file named as mouse.html
2. Define two methods mouseOn() & mouseOff() to be called when the mouse pointer comes
upon the text & out the text respectively.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
Output
38
EXPERIMENT 5(a)
AIM: Simple applications using ASP/JSP and AJAX.
Procedure:
1. Create a file named as textads.txt which contains different images and text to be displayed
for each hit of a page.
2. Create an ASP file named as “cookie_image_text.asp” to display the number of hit and to
call the file created above.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .asp extension
To execute ASP file activate IIS server as mentioned in execution step below and in URL type
localhost/Foldername/Filename.asp to run.
39
response.write(cr.ChooseContent("/textads.txt"))
%>
<html>
<body>
Output:
File Name:table_links.txt
File Name:links.txt
tablecontent_navigation.asp Page 1
page1.asp Page 2
page2.asp Page 4
page3.asp Page 3
File Name:page1.asp
<html>
<body>
<h1>
This is page 2
</h1>
40
</body>
</html>
<!-- #include file="nlcode.inc"-->
File Name:page2.asp
<html>
<body>
<h1>
This is page 3
</h1>
</body>
</html>
<!-- #include file="nlcode.inc"-->
File Name:page3.asp
<html>
<body>
<h1>
This is page 3
</h1>
</body>
</html>
<!-- #include file="nlcode.inc"-->
File Name:nlcode.inc
<%
dim nl
Set nl=Server.CreateObject("MSWC.NextLink")
if (nl.GetListIndex("links.txt")>1) then
Response.Write("<a href='" & nl.GetPreviousURL("links.txt"))
Response.Write("'>Previous Page</a>")
end if
Response.Write("<a href='" & nl.GetNextURL("links.txt"))
Response.Write("'>Next Page</a>")
%>
41
The example below builds a table of contents.
</p>
<%
dim c
dim i
set nl=server.createobject("MSWC.Nextlink")
c = nl.GetListCount("\table_links.txt")
i=1
%>
<ul>
<%do while (i <= c) %>
<li><a href="<%=nl.GetNthURL("\table_links.txt", i)%>">
<%=nl.GetNthDescription("\table_links.txt", i)%></a>
<%
i = (i + 1)
loop
%>
</ul>
<p>
The text file contains a list of page urls and link descriptions. It contains one line of text for
each page. Note that the url and description MUST be separated by the TAB character.
</p>
</body>
</html>
Output:
42
Result: The program has been executed successfully.
43
EXPERIMENT 5(b)
AIM: To create ASP program to demonstrate request & response object method.
Procedure:
Create an ASP file named as request.asp
a) Create a simple form to get the first name & last name and a button submit. When the
button is clicked the values in the text box are printed by response object by
Request.QueryString
b) Create a hyperlink with some values defined in the tag & display the same using request &
response object.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .asp extension
To execute ASP file activate IIS server as mentioned in execution step below and in URL type
localhost/Foldername/Filename.asp to run
Output :
44
EXPERIMENT 6(a)
AIM: Simple applications to demonstrate Servlets.
Procedure:
Create a java file named as Simple_Servlet.java
1. Import necessary packages.
2. Inside the doGet() method create a Date object and display it using html tags.
Solution :-
See execution steps for servlet given below
Output:
45
EXPERIMENT 6(b)
AIM: To create a servlet program to retrieve the values entered in the html file
(Using NetBeans IDE).
Procedure:
1. Create a html file named as Servlet_Html.html. Add 3 text box to get First, Middle& Last
name and a submit button. When submit button is clicked it should redirect to the servlet
program to print the values.
2. Create a java file named Servlet_HTML.java and use necessary methods to retrieve the data
from HTML file and display them.
Solutions:
See execution steps for servlet given below
46
import javax.servlet.*;
import javax.servlet.http.*;
public class Servlet_HTML extends HttpServlet {
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws IOException, ServletException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String firstName = request.getParameter("firstname");
String middleName = request.getParameter("middlename");
String lastName = request.getParameter("lastname");
out.println("<b><font color='blue'>Your FirstName is : </font></b>"+ "<b>"+ firstName
+"</b>" + "<br>");
out.println("<b><font color='blue'>Your Middle Name is : </font></b>"+ "<b>"+
middleName +"</b>" + "<br>");
out.println("<b><font color='blue'>Your Last Name is : </font></b>"+ "<b>"+ lastName
+"</b>");
}
}
Output:
47
EXPERIMENT 6(c)
AIM: To display the cookie values that are entered in the html page using servlet
program. (using NetBean IDE).
Procedure:
1. Create a html file named as getCookie.html with 3 textbox to enter any data & a submit
button. When the submit button is clicked the values in the textbox should be set as a cookie
value in “AddCookieServlet.jav” file.
2.In “AddCookieServlet.Java” file write the necessary code to get the cookie values from
.html file and store them in the cookie predefined class & display the values that are retrieved
from html.
3. Create another servlet program named as “getCookie.java” to get the values added to the
cookie predefined class & display all the values.
Solution:
See execution steps for servlet given below
Output:
48
File Name: AddCookieServlet.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class AddCookieServlet extends HttpServlet
{protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
} finally {out.close();
}
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// processRequest(request, response);
// Get parameter from HTTP request.
String data1 = request.getParameter("Name");
String data2= request.getParameter("Phone");
String data = request.getParameter("data");
// Create cookie.
//Cookie cookie = new Cookie("MyCookie", data);
Cookie cookie[]=new Cookie[10];
cookie[0] = new Cookie("Name", data1);
cookie[1] =new Cookie("Phone", data2);
cookie[2] = new Cookie("MyCookie", data);
// Add cookie to HTTP response.
// response.addCookie(cookie);
response.addCookie(cookie[0]);
response.addCookie(cookie[1]);
response.addCookie(cookie[2]);
// Write output to browser.
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<B>MyCookie has been set to");
pw.println(data);
pw.println(data1);
pw.println(data2);
pw.close();
}
public String getServletInfo() {
return "Short description";
}
}
49
Output:
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class GetCookiesServlet extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
} finally {
out.close();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// Get cookies from header of HTTP request.
Cookie[] cookies = request.getCookies();
// Display these cookies.
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<B>");
for(int i = 0; i < cookies.length; i++) {
String name = cookies[i].getName();
String value = cookies[i].getValue();
pw.println("name = " + name + "; value = " + value);
pw.println("<br>");
}
pw.close();
}
public String getServletInfo() {
50
return "Short description";
}// </editor-fold>
}
Output:
51
now start ur tomcat to check this in Explorer type http://localhost:8080 is installed and
running properly means tomcat will run to execute
-------------------
http://localhost:8080/Servlet(Foldername)/servlet1(Url-pattern)
Using Net Beans 6.5
------------------------
Open the Net Beans IDE – File – New Project – Select Java web from categories and Web
application from projects
52
EXPERIMENT 7(a)
AIM: To create a CD catalog using XML file.
Procedure:
Create an Xml file named as “cd_catalog.xml” with the following details.
<catalog>
<cd>
<title>…</title>
<artist>…</artist>
<country>…</country>
<company>…</company>
<price>…</price>
<year>…</year>
</cd>
<!-Add 3 to 4 <cd> data.-->
</catalog>
Solution :-
In notepad type the necessary code & save with the file name mentioned with .xml extension.
53
<artist>Gary Moore</artist>
<country>UK</country>
<company>Virgin records</company>
<price>10.20</price>
<year>1990</year>
</cd>
</catalog>
Output:
54
EXPERIMENT 7(b)
AIM: To create external style sheet and using the style sheet in xml file.
Procedure:
1. Create a style sheet named as cd_catalog.css and provide necessary style for the tags used
in cd_catalog.xml file
2. Create an xml file named as cd_catalog_css.xml and include the .css file created above.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .xml extension.
55
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
<CD>
<TITLE>Greatest Hits</TITLE>
<ARTIST>Dolly Parton</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>RCA</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1982</YEAR>
</CD>
</CATALOG>
Output:
56
EXPERIMENT 7(c)
AIM: To create a xsl style sheet to display the data in the xml using html table.
Procedure:
1. Create a xsl style sheet named as cd.xsl and write necessary code to access the data from
cd_catalog.xml file and display the data’s using html table tag.
2. create an xml file named as cd.xml & include the .xsl file created above.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .xml extension.
57
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
<cd>
<title>Still got the blues</title>
<artist>Gary Moore</artist>
<country>UK</country>
<company>Virgin records</company>
<price>10.20</price>
<year>1990</year>
</cd>
</catalog>
Output:
58
EXPERIMENT 8(a)
AIM: To create a php program to demonstrate the different file handling
methods.
Procedure:
Create a php file named as files.php and define the different predefined functions and
demonstrate the use of the predefined functions.
Solution:
Use PHP Designer 7 or WAMP server for ex3cuting the Php Program. Save the program with
.php extension
59
echo "<br><b>file exists-----</b>". file_exists("typecasteee.txt");
?>
Output :
60
EXPERIMENT 8(b)
AIM: To create a php program to demonstrate the different predefined function
in array, Math, Data & Regular Expression.
Procedure:
1. Create php file named as
Regularexpression.php for demonstrating the method for handling various strings with
regular expression.
Array.php for demonstrating the methods for handling the array values.
Math_function.php to demonstrate the predefined in math objects.
Date_time.php to demonstrate the predefined function in date subject.
Solution :-
Use PHP Designer 7 or WAMP server for ex3cuting the Php Program. Save the program with
.php extension
61
Output :
62
$prefix1="Mr.";
$prefix2="Mrs.";
$names[0]="John";
$names[1]="George";
$names[2]="James";
$names[3]="Anna";
$names[4]="Robert";
$names[5]="John";
$names[6]="James";
$names[7]="George";
$names[8]="Maria";
$names[9]="Peter";
$names[10]="James";
print('<br>sort function sorts array<br>');
sort($names);
$asize=sizeof($names);
echo "<br>Size of array name===".$asize;
echo "<br>";
for($i=0; $i<$asize; $i++)
{ if(($names[$i]=="Anna")||($names[$i]=="Maria"))
{ print($message.$prefix2.$names[$i]."<br>");}
else
{ print($message.$prefix1.$names[$i]."<br>");}
}
print('<br>');
echo "function array_unique removes duplicate values<br>";
$array=array();
$array=array_unique($names);
foreach($array as $key => $value)
{echo $key . "-". $value . "<br>";}
print('<br>');
rsort($array);
print("rsort function sorts array in reverse order<br>");
foreach($array as $key => $value)
{echo $key . "-". $value . "<br>";}
print('<br>array_pop($array) functions returns the last
element<br>');
$lastelement=array_pop($array);
print('<br>Last element='.$lastelement.'<br>');
print('<br>Array after caling array_pop($array): The last element
removed<br><br>');
foreach($array as $key => $value)
{echo $key . "-". $value . "<br>";}
array_push($array, "Chris", "Colin");
print('<br>Array after calling array_push($array, "Chris","Colin") and print_r: Chris and
Colin are added to the end of array<br><br>');
63
foreach($array as $key => $value)
{
echo $key . "-". $value . "<br>";
}
$names=array();
$message="Hello ";
$prefix1="Mr.";
$prefix2="Mrs.";
$names[0]="John";
$names[1]="George";
$names[2]="James";
$names[3]="Anna";
$names[4]="Robert";
$names[5]="John";
$names[6]="James";
$names[7]="George";
$names[8]="Maria";
$names[9]="Peter";
$names[10]="James";
print('<b>Is an array or not</b>');
$n="suba";
print('<br>Check whether the given variable is an array or not --'.is_array($n));
print('<br>Check whether the given variable is an array or not --'.is_array($names));
print('<br><b>Find values belong to an array or not ---</b> ');
$nam=$names[3];
echo in_array($nam,$names);
$assarray2=array("Aarthi"=>21,"Joe"=>15, "Annie"=>18);
echo "<br><b> Sorting Associative array</b><br>";
asort($assarray2);
foreach($assarray2 as $key => $value)
{
echo $key . "-". $value . "<br>";
}
echo "<h3>Print_r method </h3>";
$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
print_r ($a);
$a1=array(0=>"Cat",1=>"Dog",2=>"Horse");
$a2=array(3=>"Horse",2=>"Dog",5=>"Fish",6=>"Cat");
echo"<h3> Array intersect - compare two array key value pair</h3>";
print_r("<br>");
print_r(array_intersect($a1,$a2));
//echo "<br>".array_intersect($a1,$a2);
echo"<h3> Array keys - function returns an array containing the keys</h3>";
$a=array("a"=>"Horse","b"=>"Cat","c"=>"Dog");
print_r(array_keys($a));
print_r("<br>");
64
//echo array_keys($a);
print_r(array_keys($a,"Dog"));
print_r("<br>");
echo"<h3> Array merge - function merges one ore more arrays into one array</h3>";
print_r(array_merge($a1,$a2));
print ("<h3> Reverse printing</h3>");
$a=array("a"=>"Dog","b"=>"Cat","c"=>"Horse");
print_r(array_reverse($a));
echo"<br>";
foreach($a as $key => $value)
{
echo $key . "-". $value . "<br>";
}
print ("<h3> Shift method</h3>");
echo array_shift($a)."<br>";
print_r ($a);
$a1=array(0=>"Dog",1=>"Cat",2=>"Horse");
echo "<br>".array_shift($a1)."<br>";
print_r ($a1);
echo "<br>";
print ("<h3> Slice Method</h3>");
$a=array(0=>"Dog",1=>"Cat",2=>"Horse",3=>"Bird");
print_r(array_slice($a,1,2));
echo "<br>";
$a=array("a"=>"Dog","b"=>"Cat","c"=>"Horse","d"=>"Bird");
print_r(array_slice($a,1,2));
print ("<h3> UnShift method</h3>");
echo "<br>";
array_unshift($a,"Horse");
print_r($a);
print ("<h3> count method</h3>");
echo "<br>";
$result = count($a);
echo $result;
?>
65
Output:
66
echo "<br>ceil value====".ceil(1.75);
echo "<br>ceil value====".ceil(1.25);
echo "<br>floor value====".floor(1.75);
echo "<br>floor value====".floor(1.25);
echo "<br>exp value====".exp(2);
echo "<br>log value====".log(2.75);
echo "<br>log10 value====".log10(2.75);
echo "<br>pi value====".pi();
echo "<br>pow value====".pow(2,3);
echo "<br>round value====".round(12.55);
echo "<br>sqrt value====".sqrt(81);
echo "<br>max value====".max(12,34,23,67,33,56);
echo "<br>min value====".min(12,34,23,67,33,56);
echo "<br>Random number=====".rand(0,10);
echo "<br>Random number=====".rand();
?>
Output
67
echo("<br><b>".gmdate("l dS \of F Y h:i:s A") . "</b><br />");
echo("<h3>Oct 3,1975 was on a </h3><b>".gmdate("l",mktime(0,0,0,10,3,1975))."</b><br
/>");
echo("<br><b>TIME".time() . "</b><br />");
?>
Output :
68
EXPERIMENT 9
AIM: To create a registration form using checkbox.
Procedure :
Create an html page named as “registration.html”
a) set background colors
b) use table for alignment
c) provide font colors & size
Solution :-
In notepad type the necessary code & save with the file name mentioned with .html extension.
File Name:registrationform.html
<html>
<head>
<title>Registration Form Sample</title>
</head>
<body bgcolor="lightblue" text="red" style="font-size:15pt;font-family:Garamond"><center>
<h2>ENTRY FORM</h2></center>
<form name=form1 >
<table name=tab cellspacing=30pt>
<tr><td align=left><h2>Enter your Name :</h2></td><td align=right>
<input type=text name=t1 size=18>
<tr><td align=left><h2>Enter your Age :</h2></td><td align=right>
<input type=text name=t2 maxlength=3 size=18>
<tr><td align=left><h2>Enter your Address :</h2></td><td align=right>
<textarea name=ta rows=5 cols=15></textarea>
<tr><td align=left><h2>Sex :</h2></td><td align=left>
<input type=radio name=r1 value="female">Female<br>
<input type=radio name=r1 value=male>Male</td>
<tr><td align=left><h2>Languages Known :</h2></td><td align=left>
<center>(select more than one)</center>
<input type=checkbox name=c1 value=c>C<br>
<input type=checkbox name=c2 value=c++>C++<br>
<input type=checkbox name=c3 value=vb>VB<br>
<input type=checkbox name=c4 value=java>JAVA<br>
<input type=checkbox name=c5 value=asp>ASP<br>
<input type=checkbox name=c6 value=others>OTHERS<br></td>
<tr><td align=left><h2>Enter your Password :</h2></td><td align=right>
<input type=password name=t3 size=18>
</table><center>
<input type=reset value=" Reset " >
<input type=submit value=" Submit " >
</form>
</body>
</html>
69
Output:
70
EXPERIMENT 10
AIM: To display all the content in the database using ASP program.
Procedure:
Create a database with the name Student.mdb as shown below
File Name: Student.mdb
Create ASP program named as “db.asp” and write the necessary database connection code &
display all the content in the database using html <table>.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .asp extension
To execute ASP file activate IIS server as mentioned in execution step below and in URL type
localhost/Foldername/Filename.asp to run.
71
conn.close
%>
</table>
</body>
</html>
Output:
72
To check whether IIS is activated just type the following in the browser url, will display the
following page as shown below localhost/
73