Beruflich Dokumente
Kultur Dokumente
WEB TECHNOLOGY
Lab Manual
Intel based desktop PC, Internet Information Server, Editors, IDE’s such as ASP.Net and
any Browser
Objective
To design and develop static and dynamic websites.
Scope:
To design and implement dynamic websites with good sense of designing and
latest technical know-how's.
To flourish good grounding of web application terminologies, internet tools, web
services and e – Commerce.
List of software
IIS server, ASP.NET
XML
ASP
6. Program Counter 58
8. Session Tracking 71
Introduction to html HTML is a language for describing web pages. HTML stands for
Hyper T ext Markup Language HTML is not a programming language, it is a markup language A
markup language is a set of markup tags HTML uses markup tags to describe web pages HTML
Tags HTML markup tags are usually called HTML tags HTML tags are keywords surrounded by
angle brackets like <html> HTML tags normally come in pairs like <b> and </b> The first tag in
a pair is the start tag, the second tag is the end tag Start and end tags are also called opening tags
and closing tags
HTML Documents = Web Pages HTML documents describe web pages HTML documents
contain HTML tags and plain text HTML documents are also called web pages.
Example
< html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html >
HTML Paragraphs HTML paragraphs are defined with the <p> tag.
Example
<p>This is a paragraph.</p> <p>This is another paragraph.</p>
HTML Headings HTML headings are defined with the <h1> to <h6> tags.
Example <h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
HTML Links HTML links are defined with the <a> tag.
Example <a href =" ">This is a link</a>
HTML Images HTML images are defined with the < img > tag.
Example < img src ="well.jpg" width="104" height="142" />
Tag Description
< html> Defines an HTML document
< body> Defines the document's body
< h1> to <h6> Defines HTML headings
< hr /> Defines a horizontal line
<!--> Defines a comment
Styling HTML with CSS CSS was introduced together with HTML 4, to provide a better way to
style HTML elements. CSS can be added to HTML in the following ways: in Cascading Style
Sheet files (CSS files) in the <style> element in the HTML head section in the style attribute in
single HTML elements
Example < html >
<body style="background- color:yellow ;">
<h2 style="background- color:red ;">This is a heading</h2>
<p style="background- color:green ;">This is a paragraph.</p >
<h1 style="font- family:verdana ;">A heading</h1>
<p style="font-family:arial;color:red;font-size:20px;">A paragraph.</p>
<h1 style="text- align:center ;">Center-aligned heading</h1>
<p>This is a paragraph.</p>
</body >
</html >
HTML Images - The < img > Tag and the Src Attribute
In HTML, images are defined with the < img > tag. The < img > tag is empty, which means that
it contains attributes only, and has no closing tag. To display an image on a page, you need to use
the src attribute. Src stands for "source". The value of the src attribute is the URL of the image
you want to display .
Introduction to JavaScript:
<script> element is used to add script to a document four standard ways to include script in an
HTML document
<script> element:
Script within the <head> of a document are used to define variable or functions that may be used
later in the document
Example:
Script in the <head> defines a function that is latter called by script within the <script> block in
the <body> of the element
<head>
<script language=”javascript”>
Function alert text()
{
Alert(“hai”);
}
</head>
<body>
<script type=”text/Javascript”>
alertText();
</script>
To display the warning messages if browser does not support javascript or that Javascript is
turned off
<script>
Alert(“your java script is on “);
</script>
<noscript>
Either your browser does not support javascript or it is currently disabled
</noscript>
IIS
To execute ASP pages, a computer with web server that support the active server pages
technology is needed.
IIS
Handle large no: of web users with high performance
Personal Web server
Intended to run on windows 95 or 98
Virtual server
To execute ASP:
AIM:
PROCEDURE:-
<html>
<title> Simple Html Tags</title>
<body>
Paragraph
<p>This is a praragrspg tag.
HTML 5
One of the most important technologies on this list doesn't fully exist yet — HTML 5 — but in
2008, key features started to trickle out.
Block Quote
<center><FONT COLOR="#0000FF"> BLOCK QUOTE Tags</FONT></center>
<p>This is some text before the quotation.</p>
<block quote>This is a long block quote created with the <block quote>
Pre tag
<pre>
IT 206 JAVA
IT306 WEB SYSTEMS
IT322 WEB SYSTEMS LAB
</pre>
<h4>Letters list:</h4>
<ol type="A">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
Thus the simple html file web page has been developed successfully completed.
AIM:
To create an html file to link to different html page which contains images, tables, and
also link within a page.
PROCEDURE:-
PROGRAM
File Name:hyperlink.html
<html>
<body>
<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:
<html>
<head>
<title>Time Table</title>
</head>
<body>
<B><center><h3>
PRIST UNIVERSITY, TRICHY CAMPUS <br>
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERIGN<br>
EFFECTIVE FROM: 02.07.2013<br></center></b></h3>
OUTPUT
OUTPUT
OUTPUT
PROCEDURE:
Step 1: Create an html page named as “mixedframe.html” . Divide the page into two
columns of 25% & 75% size. In 25% display the image file created in exercise 1b
and divide the 75% into two rows. (50% & 50%). In the first 50% display the video
file created in exercise 1b, and other 50% the time table created in exercise 1b.
Step 2: Create an html page named as “navigationframe.html”. Divide the page into two
columns of 25%, 75% size. In 25% size call the hyperlink file created in exercise 1b,
and make the page to be get displayed on the other column when the link is clicked.
Step 3 : Create an html page named as “floatingframes.html”. in this file include a paragraph
to explain floating frame, and in floating frame include the any html file created in
the above exercise.
File Name:ex3.html
<html>
<html>
<frameset cols="30%,*" scrolling="no" noresize>
<frame name="one" src="ex3.html"></frame>
<frame name="two" ></frame>
</frameset>
</html>
Output:
File Name:Navigationframes.html
Output:
Output:
<html>
<frameset cols="25%,*">
<frame src="registration.html"></frame>
<frameset rows="30%,*">
<frame src="liht.jpg">
<frame src="htmlex1.html">
</frameset>
</frameset>
</html>
RESULT:
Thus the html page with different types of frames such as floating frame, navigation frame
& mixed frame successfully completed.
EX.NO:1 d) REGISTRATION FORM WITH TABLE
PROCEDURE
PROGRAM
Output:
Thus the registration form with table has been developed successfully completed.
EX.NO: 2 DEVELOPING WEB SITE USING INTERNAL AND EXTERNALCSS
ALONG WITH HTML PAGES.
To create an html file by applying the different styles using inline, external & internal style
sheets
PROCEDURE:
Output:
To developed html file by applying the different styles using external & internal style
sheets successfully completed
EX.NO 3 a) CLIENT SIDE PR GRAMMING JAVASCRIPT F R DISPLAYING
DATE AND COMPARING TWO DATES
PROCEDURE:
PROGRAM:
<html>
RESULT:
AIM:
To validate the Registration form using JavaScript.
ALGORITHM:
functionformValidation()
{
varuid = document.registration.userid;
varpassid = document.registration.passid;
varuname = document.registration.username;
varuadd = document.registration.address;
varucountry = document.registration.country;
varuzip = document.registration.zip;
varuemail = document.registration.email;
varumsex = document.registration.msex;
varufsex = document.registration.fsex;
if(userid_validation(uid,5,12))
{
if(passid_validation(passid,7,12))
{
if(allLetter(uname))
{
if(alphanumeric(uadd))
{
if(countryselect(ucountry))
{
if(allnumeric(uzip))
{
if(ValidateEmail(uemail))
{
if(validsex(umsex,ufsex))
{
}}
}}
}}
}}
return false;
functionuserid_validation(uid,mx,my)
{
varuid_len = uid.value.length;
functionallLetter(uname)
{
var letters = /^[A-Za-z]+$/;
if(uname.value.match(letters))
{
return true;
}
else
{
alert('Username must have alphabet characters only');
uname.focus();
return false;
}
}
function alphanumeric(uadd)
{
var letters = /^[0-9a-zA-Z]+$/;
if(uadd.value.match(letters))
{
return true;
}
else
{
alert('User address must have alphanumeric characters only');
uadd.focus();
functioncountryselect(ucountry)
{
if(ucountry.value == "Default")
{
alert('Select your country from the list');
ucountry.focus();
return false;
}
else
{
return true;
}
}
functionallnumeric(uzip)
{
var numbers = /^[0-9]+$/;
if(uzip.value.match(numbers))
{
return true;
}
else
{
alert('ZIP code must have numeric characters only');
uzip.focus();
return false;
}
}
functionValidateEmail(uemail)
{
varmailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(uemail.value.match(mailformat))
{
return true;
}
else
{
alert("You have entered an invalid email address!");
uemail.focus();
return false;
}
functionvalidsex(umsex,ufsex)
{
x=0;
if(umsex.checked)
{
x++;
}
if(ufsex.checked)
{
x++;
}
if(x==0)
{
alert('Select Male/Female');
umsex.focus();
return false;
}
else
{
alert('Form Succesfully Submitted');
window.location.reload()
return true;}
}
</script>
</head>
<body onload="document.registration.userid.focus();">
<h1>Registration Form</h1>
<p>Use tab keys to move from one input field to the next.</p>
<form name='registration' onSubmit="return formValidation();">
<ul>
<li><label for="userid">User id:</label></li>
<li><input type="text" name="userid" size="12" /></li>
<li><label for="passid">Password:</label></li>
<li><input type="password" name="passid" size="12" /></li>
<li><label for="username">Name:</label></li>
<li><input type="text" name="username" size="50" /></li>
<li><label for="address">Address:</label></li>
<li><input type="text" name="address" size="50" /></li>
<li><label for="country">Country:</label></li>
<li><select name="country">
<option selected="" value="Default">(Please select a country)</option>
<option value="AF">Australia</option>
<option value="AL">Canada</option>
RESULT:
Thus the web page for Registration form has been developed and validated successfully.
AIM:
To creation of XML document for a specific domain
PROCEDURE:
Step1: start the program
Step2: using Onclick (),validate the student details as entered.
Step3:In XM L file, we use styles for structure the program as #PCDATA(data field)
Step4: Using various HTML tags and attribute, we design the web page.
Step5: Using various XM L attribute list and entity list to retrieve the information of
student.
Step6: Using processing instructions which we required to describe the data.
Step7: Using “note.xml ”as xmlid to connect with html file.Execute the program.
Step8: Stop the program.
Student.html:
<HTM L>
<HEAD>
<SCRIPT>
function prev_onclick()
{
std.previousPage()
}
function next_onclick()
{
std.nextPage()
}
</SCRIPT>
</HEAD>
<BODY>
<xml id="note"src="note.xml"></xml>
<table id="std"dataSrc="#note"datapagesize="1"border="1">
<thead>
<tr><th>REGNO</th><th>NA E</th><th>COURSE</th><TH>SE </th></
tr>
</thead>
<tbody>
<tr><td><span datafld="REGNO"></span></td>
<td><span datafld="NA E"></span></td>
<td><span datafld="COURSE"></span></td>
<td><span datafld="SE "></span></td>
</tr>
</tbody>
</table>
RESULT:
AIM:
To write a program for DTD and X L schema for the domain specific XML document.
PROCEDURE:
Step1: start the program
Step2: open an X L file as Letter.xml,to create detail of person using various xml attribute
list
Step3: using user defined tags, we can create details of person using name,pincode,address,ph.no,etc..
Step4: open DTD file as letter .dtd
Step5: using an external and internaldtd, we create element list as #PCDATA for retrieve the data field
Step6: using attribute declaration, use to retrieve the data field as more than one time
Step7: Execute the program
Program:
OUTPUT
Thus the program for writing DTD or XML schema for the domain specific XM L
document has been successfully completed.
<!--PageCounter-->
<html>
<head>
<body background="yl.gif">
<p></p>
<br><br><br><br><br><br><br>
<div align="center">
<h6><font face="Times New Roman, Times, serif" size="+4" color="#0033FF">PAGE
COUNTER</font></h6></div>
<%
Set pc = Server.CreateObject("MSWC.PageCounter")
pc.PageHit
hit = pc.Hits
Reset = Request.QueryString("Reset")
If Not "" = Reset Then
pc.Reset
hit=0
End If
%>
Page counter
<! -- Std.asp-->
<HTML>
<!-- db.asp-->
<html>
<head>
<title>Inserting into Table</title>
</head>
<body >
<%
Set cn = Server.CreateObject("ADODB.Connection")
cn.Mode = adModeReadWrite
cn.provider="Microsoft.Jet.OLEDB.4.0"
cn.open server.MapPath("student.mdb")
dim rs
response.Write("Updated Successfully!")
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from student", cn , adOpenStatic , adLockPessimistic
rs.addnew
rs("name")=request("name")
rs("email")=request("email")
rs("regno")=request("regno")
rs("age")=request("age")
rs("gender")=request("gender")
<!-- mark.db-->
<HTML>
<HEAD>
<TITLE>Student Information System</TITLE>
<style type="text/css">
<!--
body {
background-color: #00CC33;
background-image: url(ntimage.gif);
}
body,td,th {
color: #CC3300;
font-weight: bold;
}
.style1 {
color: #0033CC;
font-size: 30px;
}
.style2 {
font-size: 24px;
color: #009966;
}
.style5 {font-size: 24px}
.style9 {
color: #CC6633;
font-family: Georgia, "Times New Roman", Times, serif;
}
.style10 {color: #0000CC}
.style11 {color: #0033CC}
.style12 {color: #663333}
.style15 {color: #006600}
-->
</style></HEAD>
<BODY leftmargin="50">
<form method="get" action="markdb.asp">
<hr color="#660000" noshade="noshade" size="10">
<p align="center" class="style1" >STUDENT INFORMATION SYSTEM </p>
<!--markdb.asp-->
<html>
<head>
<title>Inserting marks into Table</title>
</head>
<body >
<%
dim total
Set cn = Server.CreateObject("ADODB.Connection")
cn.Mode = adModeReadWrite
cn.provider="Microsoft.Jet.OLEDB.4.0"
cn.open server.MapPath("student.mdb")
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from student where regno=" + request("regno") + "and semest=" +
request("sem") + "and year=" + request("yea"), cn , adOpenStatic , adLockPessimistic
if (request("sem")=1) then
rs.fields("mfcs")=request("mark1")
rs.fields("co")=request("mark2")
rs.fields("dfs")=request("mark3")
rs.fields("it")=request("mark4")
rs.fields("bp")=request("mark5")
rs.fields("dfsl1")=request("mark6")
rs.fields("alpl2")=request("mark7")
total=request("mark1")+request("mark2")+request("mark3")+request("mark4")+
request("mark5")+request("mark6")+request("mark7")
rs.fields("tot1")=total
rs.fields("avg1")=total/7
rs.update
end if
if (request("sem")=2) then
rs.fields("fa")=request("mark1")
rs.fields("os")=request("mark2")
rs.fields("oops")=request("mark3")
rs.fields("ms")=request("mark4")
rs.fields("fm")=request("mark5")
rs.fields("algl1")=request("mark6")
rs.fields("osl2")=request("mark7")
total=request("mark1")+request("mark2")+request("mark3")+request("mark4")+
request("mark5")+request("mark6")+request("mark7")
rs.fields("tot2")=total
rs.fields("avg2")=total/7
rs.update
end if
<!--smark.asp-->
<HTML>
<HEAD>
<TITLE>Student Information System</TITLE>
<style type="text/css">
<!--
body {
background-color: #00CC33;
background-image: url(ntimage.gif);
}
body,td,th {
color: #CC3300;
font-weight: bold;
}
.style1 {
color: #0033CC;
font-size: 30px;
}
.style2 {
font-size: 24px;
color: #009966;
}
.style5 {font-size: 24px}
.style9 {
color: #CC6633;
font-family: Georgia, "Times New Roman", Times, serif;
}
.style10 {color: #0000CC}
.style11 {color: #0033CC}
.style12 {color: #663333}
.style15 {color: #006600}
-->
</style></HEAD>
<BODY leftmargin="50">
<form method="get" action="searchmark.asp">
<hr color="#660000" noshade="noshade" size="10">
<p align="center" class="style1" >STUDENT INFORMATION SYSTEM </p>
<p align="center" class="style2" >DEPARTMENT OF MCA </p>
<hr color="#660000" noshade="noshade" size="10">
<p align="center"><span class="style5">
Output:
</div>
</form>
</body>
</html>
<!--login.asp-->
<html>
<head><title>Session Pradeepkumar.V</title>
<style type="text/css">
<!--
.style1 {
color: #993333;
font-weight: bold;
}
-->
</style>
</head>
<body bgcolor=white >
<!--db.asp-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<%
set ConnObj = Server.CreateObject("ADODB.Connection")
ConnObj.Mode = adModeWrite
ConnObj.Open "driver = {Microsoft Access Driver (*.mdb)};DBQ=" &
Server.MapPath("emp.mdb")
Line1 = "INSERT INTO empdet (name,email,empno,age,gender,address,desig,basic) VALUES
('"&request("name")&"','"&request("email")&"',"&cint(request("empno"))&","&cint(request("ag
e"))&",'"&request("gender")&"','"&request("address")&"','"&request("desig")&"',"&cdbl(request
("basic"))&")"
CommandText = Line1
ConnObj.Execute CommandText, RecordsAffected, adCmdText
ConnObj.Close
<!--pay.asp-->
<HTML>
<HEAD>
<TITLE></TITLE>
<style type="text/css">
<!--
body {
background-color: #00CC33;
background-image: url(ntimage.gif);
}
body,td,th {
color: #CC3300;
font-weight: bold;
}
.style1 {
color: #0033CC;
font-size: 30px;
}
.style2 {
font-size: 24px;
color: #009966;
}
.style5 {font-size: 24px}
.style9 {
color: #CC6633;
font-family: Georgia, "Times New Roman", Times, serif;
}
.style10 {color: #0000CC}
.style11 {color: #0033CC}
<%
dim hra,da,cca,net
Set cn = Server.CreateObject("ADODB.Connection")
cn.provider="Microsoft.Jet.OLEDB.4.0"
cn.Mode = adModeReadWrite
cn.open server.MapPath("emp.mdb")
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from empdet",cn
rs.movefirst()
do while not rs.eof
if cint(request("empno"))=rs.fields("empno") then
hra=rs.fields("basic")*0.5
da=rs.fields("basic")*0.10
cca=rs.fields("basic")*0.3
pf=rs.fields("basic")*0.2
net=hra+da+cca-pf
exit do
else
rs.movenext()
end if
loop
%>
<form method="get" action="paydb.asp">
<hr color="#660000" noshade="noshade" size="10">
<p align="center" class="style1" >EMPLOYEE INFORMATION SYSTEM </p>
<p align="center" class="style2" >PUDUCHERRY</p>
<hr color="#660000" noshade="noshade" size="10">
<p align="center"><span class="style5">
<marquee>
</marquee>
<span class="style9">Employee Payroll Information </span></span></p>
<p align="center"><span class="style10">Empno</span>
<input align="absmiddle" type="text" name="empno" value="<%
response.Write(request("empno"))%>">
</p>
<p align="center"> </p>
<hr color="#FF0000" size="3">
<p align="center" class="style12">Enter Mark Details</p>
<p align="center"><span class="style15">Hra</span>
<!--paydb.ap-->
<html>
<head>
<title></title>
</head>
<body >
<%
Set cn = Server.CreateObject("ADODB.Connection")
cn.Mode = adModeReadWrite
cn.provider="Microsoft.Jet.OLEDB.4.0"
cn.open server.MapPath("emp.mdb")
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from empdet where empno="&request("empno")&"" , cn , adOpenStatic ,
adLockPessimistic
rs.fields("hra")=cdbl(request("hra"))
rs.fields("da")=cdbl(request("da"))
rs.fields("cca")=cdbl(request("cca"))
rs.fields("pf")=cdbl(request("pf"))
rs.fields("net")=cdbl(request("net"))
rs.update
response.Write("Updated Successfully!")
<!--searchpay.asp-->
<HTML>
<HEAD>
<TITLE></TITLE>
<style type="text/css">
<!--
body {
background-color: #00CC33;
background-image: url(ntimage.gif);
}
body,td,th {
color: #CC3300;
font-weight: bold;
}
.style1 {
color: #0033CC;
font-size: 30px;
}
.style2 {
font-size: 24px;
color: #009966;
}
.style5 {font-size: 24px}
.style9 {
color: #CC6633;
font-family: Georgia, "Times New Roman", Times, serif;
}
.style10 {color: #0000CC}
.style11 {color: #0033CC}
.style12 {color: #663333}
.style15 {color: #006600}
-->
</style></HEAD>
<BODY leftmargin="50">
<form method="GET" runat="server" >
<%
dim hra,da,cca,net
Set cn = Server.CreateObject("ADODB.Connection")
cn.provider="Microsoft.Jet.OLEDB.4.0"
cn.Mode = adModeReadWrite
cn.open server.MapPath("emp.mdb")
dim rs
<p>Year
<!--db.asp-->
<html>
<head>
<title>Inserting into Table</title>
</head>
<body >
<%
dim str
Set cn = Server.CreateObject("ADODB.Connection")
cn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" +
server.MapPath("cricket.mdb")
cn.Open
str = "Insert into cricket(name,score,wick,age,gender,match,year)
values('"&request("name")&"',"&request("score")&","&request("wick")&","&request("age")&",
'"&request("gender")&"','"&request("match")&"',"&request("year")&")"
cn.Execute str
response.Redirect("disp.asp")
%>
</body>
</html>
<!--disp.asp-->
<HTML>
<HEAD>
<TITLE>Student Information System</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY leftmargin="50">
<form method="post" name="frm1">
<hr color="#660000" noshade="noshade" size="10">
<p align="center" > </p>
<p align="center" ><strong>CRICKET INFORMATION SYSTEM </strong></p>
<p align="center" > </p>
<hr color="#660000" noshade="noshade" size="10">
<div align="center">