Sie sind auf Seite 1von 98

DEPARTMENT OF MASTER OF COMPUTER APPLICATIONS

WEB TECHNOLOGY
Lab Manual

Lab Code: P41(4)


For II Year / IV Sem

Department of MCA, SMVEC Page 1


System Requirements

Recommended Systems / Software Requirements:

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

The courses contains

• WEBBASICS: Design web pages through coding using HTML


• EDITOR: Notepad
• BROWSER SIDE SCRIPTING using JavaScript with a focus on Event Handling and
Validation
• SERVER SIDE SCRIPTING: ASP
•BROWSER SIDE SCRIPTING: Introduction to programming world of XML
Technologies.

Department of MCA, SMVEC Page 2


TABLE OF CONTENTS

S.NO TOPICS PAGE.NO

HTML,CSS AND JAVA SCRIPT


Simple HTML
1.a) 11
Hyper Links
1.b) 19
Using Frames
1.c) 27
Registration Form with Table
1.d) 29
Internal Style ,and external Style Sheets
2. 32
3.a) JavaScript for displaying date and comparing two dates. 39

3.b) Form validation including text field, radio buttons, 46


checkboxes, list box and other controls

XML

4. Creation of XML document for a specific domain 51

5 DTD or XML schema for the domain specific XML 55


Document

ASP
6. Program Counter 58

7. Student Info System 63

8. Session Tracking 71

9. Employee Management System 83

10. Cricket Information System 94

Department of MCA, SMVEC Page 3


Introduction to HTML

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

HTML Line Breaks


Use the < br /> tag if you want a line break (a new line) without starting a new paragraph:
Example <p>This is< br />a para < br />graph with line breaks</p>
TagDescription
< abbr > Defines an abbreviation

Department of MCA, SMVEC Page 4


< acronym> Defines an acronym
< address> Defines contact information for the author/owner of a document
< bdo > Defines the text direction
< blockquote > Defines a long quotation
< q> Defines a short quotation
< cite> Defines a citation
< dfn > Defines a definition term
<b> Defines bold text
< big> Defines big text
< em > Defines emphasized text
< i > Defines italic text
< small> Defines small text
< strong> Defines strong text
< sub> Defines subscripted text
< sup> Defines superscripted text
< ins> Defines inserted text
<del> Defines deleted text

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 .

HTML Tables are defined with the <table> tag.


A table is divided into rows (with the < tr > tag), and each row is divided into data cells (with the
<td> tag). td stands for "table data," and holds the content of a data cell.
A <td> tag can contain text, links, images, lists, forms, other tables
Example <html>
<body> <table border="1">

Department of MCA, SMVEC Page 5


<caption>Monthly savings</caption>
< tr > < th >Month</ th > < th >Savings</ th > </ tr >
< tr > <td>January</td> <td>$100</td> </ tr >
< tr > <td>February</td> <td>$50</td> </ tr >
</table>
</body>
</html>

Introduction to JavaScript:

<script> element is used to add script to a document four standard ways to include script in an
HTML document

 Within the <script> element


 As alinked file via the src attributes of the <script> element
 Within an HTML event handler attribute such as onclick
 Via the Pseudo URL javascript: syntax reference by a link

<script> element:

<script language = “Javascript”>


Document.witeln(“Welcome”)
Alert(“hai”);
</script>

Script in the head:

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>

Department of MCA, SMVEC Page 6


</body>

<no script> element:

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>

Active Server Page


What is ASP?

 It is a form of server side scripting to create dynamic web page


 IT allows applications with scripts and components to perform multiple actions
 ASP allow us to combine standard HTML elements like labels, text and titles with
scripting language elements like data base fields, date/time information and personal
customization to produces web page that is dynamically generated every time. When the
page is requested from a browser.
 The browser requests the active server page; which is then processed by the Internet
information server(IIS). IIS then runs the VBScript, turning it into standard HTML tags
and text. The resulting page can be viewed virtually by any browser.

How ASP works?

 Type in a requests to visit a site


Eg: http:// www.xyz.com/sales.asp
 The request for the page routes its way to the Internet Information Server(IIS)
 IIS retrieves the requested file
 It must be noted that the request has the file extension of .asp
 The request tells the IIS that this is a dynamic page containing scripts that must be
interpreted.
 IIS computer the ASP code, which can required the launching of other components like,
o Sac server
o Browser capability component
o Ad rotator component
o Shopping cart component
 The component allow us to read from a database the contents of a current data

Department of MCA, SMVEC Page 7


 All of this script and components code is converted into standard HTML that is sent back
to the user through browsing
 The user’s browser receives the HTML only and displays to the website’s dynamic
contents.

The diagrammatic representation of the process is shown below.

Advantages of ASP and Server Side scripting

 Has the control over the components


 Output of the browser is standard HTML
 Security

IIS

To execute ASP pages, a computer with web server that support the active server pages
technology is needed.

Two famous web server

 IIS
 Handle large no: of web users with high performance
 Personal Web server
 Intended to run on windows 95 or 98

NOTE: older version of IIS support 5 domains

Virtual server

Department of MCA, SMVEC Page 8


 IIS can configure several domain for the same computer
 Windows NT server supports multiple Network Interface cards; multiple IP addresses for
the same computer.

To execute ASP:

 Install web server


 Create ASP pages is the websites root physical directory (or)
 In the subdirectory root physical directory
 View the result of ASP pages through web browser.

Department of MCA, SMVEC Page 9


EX.NO: 1 a) SIMPLE HTML

AIM:

To create a simple html file to demonstrate the use of different tags.

PROCEDURE:-

Step 1 : Start the program


Step 2 : Set the title of the page as “Simple HTML Tags”
Step 3 : 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)

Department of MCA, SMVEC Page 10


PROGRAM

File Name: Simple_html_tags.html

<html>
<title> Simple Html Tags</title>
<body>

Moving text = “Simple HTML Tags”


<marquee> Simple HTML Tags</marquee>

Different heading tags ( h1 to h6)


<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>
<center><FONT COLOR="#0000FF"> Text Elements</FONT> </center>

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.

Department of MCA, SMVEC Page 11


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.
</p>
Horizontal line , Line Break
<hr>
<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>
<hr>

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>

Different Logical Style ( <b>, <c>, <sub>, <sup>….)


<hr>
<Center> <FONT COLOR="#0000FF"> Logical style </FONT></center>
This is <b>bold</b> This is bold<br>

Department of MCA, SMVEC Page 12


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>
<hr>

Different Physical style ( <code>, <del>, <kbd>…)


<hr>
<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> code <br>
<samp>code</samp> code <br>
This is <strong>strong</strong>. This is strong.<br>
<var>program</var> variable program variable<br>
<br>
<hr>
Listing tags
<center><FONT COLOR="#0000FF"> Listing Tags</FONT></center>
<h4>Numbered list :</h4>
<ol>
<li>Apples</li>

Department of MCA, SMVEC Page 13


<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</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>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>

Department of MCA, SMVEC Page 14


<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>

Department of MCA, SMVEC Page 15


Output:

Department of MCA, SMVEC Page 16


Department of MCA, SMVEC Page 17
RESULT:

Thus the simple html file web page has been developed successfully completed.

EX.NO: 1b) HYPER LINK

AIM:
To create an html file to link to different html page which contains images, tables, and
also link within a page.

PROCEDURE:-

Step 1 : Start the program


Step 2 : 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.
Step 3 : 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.)
Department of MCA, SMVEC Page 18
Step 4 . Create an html page named as “image.html” to display image at various position & size.
Step 5 : Create an html page named as “video.html” to display the audio and video files.

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:

Department of MCA, SMVEC Page 19


File Name: Table.html

<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>

<table border="2" width="75%" cellspacing="2" cellpadding="25" align=center><h3>

<caption align=left>Class: III CSE


’&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Department of MCA, SMVEC Page 20


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; R.No:106</caption></h3>
<thead>
<tr>
<th >Periods</th>
<th ROWSPAN=2>1 <br>9.00-9.45</th>
<th ROWSPAN=2>2<br>9.45-10.30</th>
<th ROWSPAN=2>3<br>10.45-11.30</th>
<th ROWSPAN=2>4<br>11.30-12.15</th>
<th ROWSPAN=2>5<br>1.00-1.45</th>
<th ROWSPAN=2>6<br>1.45-2.30</th>
<th ROWSPAN=2>7<br>2.45-3.30</th>
<th ROWSPAN=2>8<br>3.30-4.15</th>
</tr>
<tr><th> Days</th>
</thead>
<tbody>
<tr>
<th>Monday</th>
<td>CS0302</td>
<td>CS0306</td>
<td>CS0304</td>
<td>CS0306</td>
<td>CS0302</td>
<td> CS0301</td>
<td COLSPAN=2><center>CS0324</td>
</tr>
<tr>
<th>TuesDay</th>
<td COLSPAN =4 bgcolor="cyan"><center>CS0320/CS0322</td>
<td>CS0310</td>
<td>CS0304</td>
<td>CS0308</td>
<td>CS0302</td>
</tr>
<tr>
<th>Wednesday</th>
<td COLSPAN =2 bgcolor="red"><center>ELETIVE - I</td>
<td>CS0306</td>
<td>CS0310</td>
<td>CS0304</td>
<td>CS0308</td>
<td>LIB</td>
<td>.Net</td>

Department of MCA, SMVEC Page 21


</tr>
<tr>
<th>Thursday</th>
<td>CS0302</td>
<td>CS0304</td>
<td COLSPAN=2><center>PD0302</td>
<td>CS0301</td>
<td COLSPAN=3 bgcolor="cyan"><center>CS0320/CS0322</td>
</tr>
<tr>
<th>Friday</th>
<td>CS0308</td>
<td>CS0306</td>
<td>CS0308</td>
<td>CS0302</td>
<td>CS0305</td>
<td COLSPAN=3 bgcolor="red"><center>ELECTIVE - I</td>
</tr>
</tbody>
</table>
</body>
</html>

OUTPUT

Department of MCA, SMVEC Page 22


File Name: image.html

Department of MCA, SMVEC Page 23


<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

File Name: video.html

Department of MCA, SMVEC Page 24


<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

Department of MCA, SMVEC Page 25


RESULT:
To developed html file to link to different html page which contains images, tables, and
also link within a page successfully completed

EX.NO:1 c) USING FRAMES

Department of MCA, SMVEC Page 26


AIM:
To create an html page with different types of frames such as floating frame, navigation
frame & mixed frame.

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>

Department of MCA, SMVEC Page 27


<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>
<frame name="two" ></frame>
</frameset>
</html>

Output:

File Name:Navigationframes.html

Department of MCA, SMVEC Page 28


<html>
<frameset cols="30%,*" scrolling="no" noresize>
<frame name="one" src="ex3.html"></frame>
<frame name="two" ></frame>
</frameset>
</html>

Output:

File Name: floatingframe.html


<html>
<body>

Department of MCA, SMVEC Page 29


<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:

Department of MCA, SMVEC Page 30


File Name: mixedframe.html

<html>
<frameset cols="25%,*">
<frame src="registration.html"></frame>
<frameset rows="30%,*">
<frame src="liht.jpg">
<frame src="htmlex1.html">
</frameset>
</frameset>
</html>

Department of MCA, SMVEC Page 31


Output:

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

Department of MCA, SMVEC Page 32


AIM

To create a registration form with table.

PROCEDURE

STEP 1 : Create an html page named as “registration.html”


a) Set background colors
b) Use table for alignment
c) Provide font colors & size

PROGRAM

Department of MCA, SMVEC Page 33


</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>

Output:

Department of MCA, SMVEC Page 34


RESULT:

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.

Department of MCA, SMVEC Page 35


AIM:

To create an html file by applying the different styles using inline, external & internal style
sheets

PROCEDURE:

Step 1: Start the program.


Step 2 : Create a external style sheet named as “external_css.css” and provide some
styles for h2, hr, p & a tags.
Step 3 : 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.

File Name: Style_Sheet.html

Department of MCA, SMVEC Page 36


<html>
<head>
<link rel="stylesheet" type="text/css" href="external_style.css" />
<style type="text/css">
body
{
margin-left:200px;
background:#5d9ab2 url('img_tree.png') no-repeat top left;
}
.container
{
text-align:center;
}
.center_div
{
border:1px solid gray;
margin-left:auto;
margin-right:auto;
width:90%;
background-color:#d0f0f6;
text-align:left;
padding:8px;
}
</style>
</head>
<body>
<div class="container">
<div class="center_div">
<h1>Hello World!</h1>
<p>This example contains some advanced CSS methods you may not have learned yet. But, we
will explain these methods in a later chapter in the tutorial.</p>

Department of MCA, SMVEC Page 37


</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:

Department of MCA, SMVEC Page 38


RESULT

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

Department of MCA, SMVEC Page 39


AIM:
To validate the comparing two dates using JavaScript.

PROCEDURE:

Step 1: start the program.


Step 2: Using JavaScript, we validate whether the text and other text fields are empty or to be filled.
Step 4: Validate the date that should be in date format (dd-mmyy).
Step 5: check the comparison of two text fields.
Step 6: Execute the program in Internet explorer.
Step 7: Stop the program.

PROGRAM:
<html>

Department of MCA, SMVEC Page 40


<head>
<title>Compare Dates</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<Script Language=Javascript>
function CompareDates()
{
var str1 = document.getElementById("Fromdate").value;
var str2 = document.getElementById("Todate").value;
var dt1 = parseInt(str1.substring(0,2),10);
var mon1 = parseInt(str1.substring(3,5),10);
var yr1 = parseInt(str1.substring(6,10),10);
var dt2 = parseInt(str2.substring(0,2),10);
var mon2 = parseInt(str2.substring(3,5),10);
var yr2 = parseInt(str2.substring(6,10),10);
var date1 = new Date(yr1, mon1, dt1);
var date2 = new Date(yr2, mon2, dt2);
if(date2 < date1)
{
alert("To date cannot be greater than from date");
return false;
}else
{
alert("Submitting ...");
document.form1.submit();
}}
</Script>
</head>
<body bgcolor="#FFFFdd" text="#000000">
<br>
<br>
<h1 align=center style={color:maroon}><u>Date
Comparison</u></h1><br><br>
<center>
Department of MCA, SMVEC Page 41
<form name="form1" method="post" action="">
<input type="text" name="fromdate" id="fromdate" value="">
<input type="text" name="todate" id="todate" value=""><br><br><br>
<input type="button" value="compare dates" onclick="CompareDates()">
</form>
</center>
</body>
</html>

Department of MCA, SMVEC Page 42


OUTPUT

RESULT:

Department of MCA, SMVEC Page 43


Thus the program for JavaScript for displaying date and comparing two Dates has been
successfully compiled and executed.

EX.NO 2 b) FORM VALIDATION INCLUDING TEXTFIELD, RADIO


BUTTONS, CHECKBOXES, LISTBOX AND OTHER
CONTROLS

AIM:
To validate the Registration form using JavaScript.

ALGORITHM:

Step 1: start the program.


Step 2: Design a home page registration form using different html tags,forms and attributes.
Step 3: Using JavaScript, we validate whether the text and other text fields are empty or to be filled.
Step 4: Check whether the checkbox has been already checked or not.
Step 5: Check whether the radio button has been already checked or not.
Step 6: Check whether the nick name is used as a password or not.
Step 7: Validate the date of birth that should be in date format (dd-mmyy) or not.
Step 8: Allow the age field size should be two and only be the numbers.
Step 9: In the name field, ensure that it should allow only the capital letters.
Step 10: Check that the password field contains only the 8 characters.
Step 11: Execute the program in Internet explorer.
Step 12: Stop the program.

Department of MCA, SMVEC Page 44


PROGRAM
<html lang="en">
<head>
<title>JavaScript Form Validation using a registration form
</title>
<script type="text/javascript">

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;

Department of MCA, SMVEC Page 45


if (uid_len == 0 || uid_len>= my || uid_len< mx)
{
alert("User Id should not be empty / length be between "+mx+" to "+my);
uid.focus();
return false;
}
return true;
}
}
functionpassid_validation(passid,mx,my)
{
varpassid_len = passid.value.length;
if (passid_len == 0 ||passid_len>= my || passid_len< mx)
{
alert("Password should not be empty / length be between "+mx+" to "+my);
passid.focus();
return false;
}
return true;
}

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();

Department of MCA, SMVEC Page 46


return false;
}
}

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;
}

Department of MCA, SMVEC Page 47


}

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>

Department of MCA, SMVEC Page 48


<option value="DZ">India</option>
<option value="AS">Russia</option>
<option value="AD">USA</option>
</select>
</li>
<li><label for="zip">ZIP Code:</label></li>
<li><input type="text" name="zip" /></li>
<li><label for="email">Email:</label></li>
<li><input type="text" name="email" size="50" /></li>
<li><label id="gender">Sex:</label></li>
<li><input type="radio" name="msex" value="Male"
/><span>Male</span></li>
<li><input type="radio" name="fsex" value="Female"
/><span>Female</span></li>
<li><label>Language:</label></li>
<li><input type="checkbox" name="en" value="en" checked
/><span>English</span></li>
<li><input type="checkbox" name="nonen" value="noen" /><span>Non
English</span></li>
<li><label for="desc">About:</label></li>
<li><textarea name="desc" id="desc"></textarea></li>
<li><input type="submit" name="submit" value="Submit" /></li>
</ul>
</form>
</body>
</html>

Department of MCA, SMVEC Page 49


OUTPUT:

RESULT:

Thus the web page for Registration form has been developed and validated successfully.

Department of MCA, SMVEC Page 50


EX.NO: 7 CREATI N OF XML DOCUMENT FOR A SPECIFIC DOMAIN
DATE:

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.

Department of MCA, SMVEC Page 51


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>

Department of MCA, SMVEC Page 52


<INPUT TYPE="BUTTON"VALUE="NEXT"ONCLICK="next_onclick()">
<INPUT TYPE="BUTTON"VALUE="PREVIOUS"
ONCLICK="prev_onclick()">
</BODY>
</HT L>
note.xml:
<?xml version="1.0"?>
<note>
<STUDENT>
<REGNO>V P49</REGNO>
<NA E>THANUJA.O</NA E>
<COURSE>.E CSE</COURSE>
<SE >II</SE >
</STUDENT>
<STUDENT>
<REGNO>V P52</REGNO>
<NA E>TA ILARASI</NA E>
<COURSE>.E CSE</COURSE>
<SE >II</SE >
</STUDENT>
</note>

Department of MCA, SMVEC Page 53


OUTPUT

RESULT:

Thus the developing XML program has been executed successfully.

Department of MCA, SMVEC Page 54


EX.NO: 8 WRITING DTD OR XML SCHEMA FOR THE DOMAIN
DATE: SPECIFIC XML DOCUMENT

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:

Department of MCA, SMVEC Page 55


Letter.xml:
<?xml version="1.0"?>
<letter>
<contact type="sender">
<name>aaaa</name>
<address>dfdsgdsgdsfvg</address>
<city>chennai</city>
<state>tamilnadu</state>
<zip>600089</zip>
<phone>044-23456789</phone>
<flag gender="F"/>
</contact>
<contact type="receiver">
<name>bbbb</name>
<address1>dfdsgdsgdsfvg</address1>
<address2>fvgefgffdg</address2>
<city>chennai</city>
<state>tamilnadu</state>
<zip>600089</zip>
<phone>044-23456789</phone>
<flag gender="F"/>
</contact>
<salutation>Dear Sir:</salutation>
<paragraph>It is our privillege .........</paragraph>
<closing>Sincerely</closing>
<signature>s.aaaaa</signature>
</letter>
Letter.dtd:
<!element letter(contact+,salutation,paragraph+,closing,signature)>
<element contact(name,address1,address2,city,state,zip,phone,flag)>
<!attlist contacttype CDATA #implied>
<!element address1(#PCDATA)>
<!element address2(#PCDATA)>
<!element city(#PCDATA)>
<!element state(#PCDATA)>
<!element zip(#PCDATA)>
<!element phone(#PCDATA)>
<!element flag E PTY>
<!attlist flag gender(/F)"">
<!element salutation(#pcdata)>
<!element closing (#pcdata)>
<!element paragraph (#pcdata)>
<!element signature (#pcdata)>

OUTPUT

Department of MCA, SMVEC Page 56


RESULT:

Thus the program for writing DTD or XML schema for the domain specific XM L
document has been successfully completed.

<!--PageCounter-->
<html>
<head>

Department of MCA, SMVEC Page 57


<title>This is Pradeepkumar's Page Counter</title>
</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
%>

<FORM NAME="ResetHitCounter" METHOD="GET" ACTION="pgctr.asp">


<div align="center"><input border="0" align="absmiddle" size="50" type="text"
name="Pagehits" value="<% response.Write("Number of Hits :" & hit) %>"><br><br><br>
</div>
<div align="center"><INPUT TYPE="SUBMIT" NAME="Reset" VALUE="Reset Hit
Counter">
<INPUT TYPE="SUBMIT" NAME="Hit" VALUE="Increment Hit Counter"></div>
</FORM>
<br><br>
<div align="center">
<marquee><h6><font face="Times New Roman, Times, serif" size="+3" color="#CC0000">By
PradeepKumar.V</font></h6></marquee></div>
</body>
</html>

<!--Adrotator program -->


<html>
<head>

Department of MCA, SMVEC Page 58


<title></title>
</head>
<body >
<%
dim adobj
set adobj = Server.CreateObject("MSWC.Adrotator")
response.Write adobj.GetAdvertisement("\adrotator\rotext.txt")
%>
</body>
</html>
rotext.txt
*
http:\\localhost\adrotator\imgbanner.jpg
http:\\localhost\adrotator\img.html
This is a Adrotator program
2
http:\\localhost\adrotator\imgbanner1.jpg
http:\\localhost\adrotator\img.html
This is a Adrotator program
2

Page counter

Department of MCA, SMVEC Page 59


RESULT:
Thus the program for program counter has been successfully completed.

<! -- Std.asp-->
<HTML>

Department of MCA, SMVEC Page 60


<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: #9900FF}
-->
</style></HEAD>
<BODY leftmargin="50">
<form method="get" name="frm1" action="db.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><span class="style5">
<span class="style9">Students Personal Information </span></span></p>
<p>Name&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="name" >
</p>
<p> Email&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="email" >
</p>
<p>
Regno&nbsp;&nbsp;&nbsp;
<input type="text" name="regno">
</p>
<p> Age&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="age">
</p>
<p>Gender &nbsp;

Department of MCA, SMVEC Page 61


<label>
<input name="gender" type="radio" value="Male">
Male</label>
<label>
<input name="gender" type="radio" value="Female">
Female</label>
</p>
<p> Address&nbsp;
<textarea name="address"></textarea>
</p>
<p>Semester
<input type="text" name="sem">
</p>
<p>Year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="year">
</p>
<hr color="#003399" size="8">
<div align="center">
<input type="submit" name="Submit" value="Submit" >
</div>
<hr color="#003399" size="8">
</form>
</BODY>
</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")

Department of MCA, SMVEC Page 62


rs("address")=request("address")
rs("semest")=request("sem")
rs("year")=request("yea")
rs.update
response.Write("Updated Successfully!")
%>
</body>
</html>

<!-- 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>

Department of MCA, SMVEC Page 63


<p align="center" class="style2" >DEPARTMENT OF MCA </p>
<hr color="#660000" noshade="noshade" size="10">
<p align="center"><span class="style5">
<marquee>
</marquee>
<span class="style9">Students Mark Information </span></span></p>
<p align="center"><span class="style10">Regno</span>&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="regno">
</p>
<p align="center"> <span class="style11">Semester</span>
<input align="absmiddle" type="text" name="sem" >
</p>
<p align="center"> <span class="style11">Year
</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="yea">
</p>
<hr color="#FF0000" size="3">
<p align="center" class="style12">Enter Mark Details</p>
<p align="center"><span class="style15">Mark1</span>
<input type="text" name="mark1">
</p>
<p align="center"><span class="style15">Mark2</span>
<input type="text" name="mark2">
</p>
<p align="center"><span class="style15">Mark3</span>
<input type="text" name="mark3">
</p>
<p align="center"><span class="style15">Mark4</span>
<input type="text" name="mark4">
</p>
<p align="center"><span class="style15">Mark5</span>
<input type="text" name="mark5">
</p>
<p align="center"><span class="style15">Mark6</span>
<input type="text" name="mark6">
</p>
<p align="center"><span class="style15">Mark7</span>
<input type="text" name="mark7">
</p>
<hr color="#003399" size="8">
<div align="center">
<input type="submit" name="Submit" value="Submit" >
</div>
<hr color="#003399" size="8">
</form>
</BODY>

Department of MCA, SMVEC Page 64


</HTML>

<!--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

Department of MCA, SMVEC Page 65


response.Write("Updated Successfully!")
%>
</body>
</html>

<!--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">

Department of MCA, SMVEC Page 66


<span class="style9">Students Mark Information ! Enter the details for the Result
</span></span></p>
<p align="center"><span class="style10">Regno</span>&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="regno">
</p>
<p align="center"> <span class="style11">Semester</span>
<input align="absmiddle" type="text" name="sem" >
</p>
<p align="center"> <span class="style11">Year
</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="year">
</p>
<hr color="#FF0000" size="3">
<p align="center" class="style12">&nbsp;</p>
<hr color="#003399" size="8">
<div align="center">
<input type="submit" name="Submit" value="Submit" >
</div>
<hr color="#003399" size="8">
</form>
</BODY>
</HTML>
<!--searchmark.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 {

Department of MCA, SMVEC Page 67


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 m1,m2,m3,m4,m5,m6,m7,tot,avg,result
Set cn = Server.CreateObject("ADODB.Connection")
cn.provider="Microsoft.Jet.OLEDB.4.0"
cn.Mode = adModeReadWrite
cn.open server.MapPath("student.mdb")
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from student",cn
rs.movefirst()
do while not rs.eof
if cint(request("regno"))=rs.fields("regno") and cint(request("sem"))=rs.fields("semest") and
cint(request("year"))=rs.fields("year")then
if cint(request("sem"))=1 then
m1=rs.fields("mfcs")
m2=rs.fields("co")
m3=rs.fields("dfs")
m4=rs.fields("it")
m5=rs.fields("bp")
m6=rs.fields("dfsl1")
m7=rs.fields("alpl2")
tot=rs.fields("tot1")
avg=rs.fields("avg1")
result=rs.fields("result1")
exit do
end if
if cint(request("sem"))=2 then
m1=rs.fields("fa")
m2=rs.fields("os")
m3=rs.fields("oops")
m4=rs.fields("ms")
m5=rs.fields("fm")
m6=rs.fields("algl1")
m7=rs.fields("osl2")
tot=rs.fields("tot2")

Department of MCA, SMVEC Page 68


avg=rs.fields("avg2")
result=rs.fields("result2")
exit do
end if
else
rs.movenext()
end if
loop
%>
<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">
<marquee>
</marquee>
<span class="style9">Students Mark Information </span></span></p>
<p align="center"><span class="style10">Regno</span>&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="regno" value="<
%response.Write(rs.fields("regno"))%>">
</p>
<p align="center"> <span class="style11">Semester</span>
<input align="absmiddle" type="text" name="sem" value="<
%response.Write(rs.fields("semest"))%>">
</p>
<p align="center"> <span class="style11">Year
</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="year" value="<%response.Write(rs.fields("year"))%>">
</p>

<hr color="#FF0000" size="3">


<p align="center" class="style12">The Result of Marks</p>
<p align="center"><span class="style15">Mark1</span>
<input type="text" name="mark1" value="<%response.Write(m1)%>">
</p>
<p align="center"><span class="style15">Mark2</span>
<input type="text" name="mark2" value="<%response.Write(m2)%>">
</p>
<p align="center"><span class="style15">Mark3</span>
<input type="text" name="mark3" value="<%response.Write(m3)%>">
</p>
<p align="center"><span class="style15">Mark4</span>
<input type="text" name="mark4" value="<%response.Write(m4)%>">
</p>
<p align="center"><span class="style15">Mark5</span>
<input type="text" name="mark5" value="<%response.Write(m5)%>">

Department of MCA, SMVEC Page 69


</p>
<p align="center"><span class="style15">Mark6</span>
<input type="text" name="mark6" value="<%response.Write(m6)%>">
</p>
<p align="center"><span class="style15">Mark7</span>
<input type="text" name="mark7" value="<%response.Write(m7)%>">
</p>
<hr color="#FF0000" size="3">
<p align="center"><span class="style15">Total</span>
&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="tot" value="<%response.Write(tot)
%>">
</p>
<p align="center"><span class="style15">Average</span>
<input type="text" name="avg" value="<%response.Write(avg)%>">
</p>
<p align="center"><span class="style15">Result</span>
&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="mark7" value="<
%response.Write(result)%>">
</p>
<hr color="#003399" size="8">
</form>
</BODY>
</HTML>

Output:

Department of MCA, SMVEC Page 70


Department of MCA, SMVEC Page 71
Department of MCA, SMVEC Page 72
Department of MCA, SMVEC Page 73
<!--Session Tracking-->
<!--new.asp-->
<html>
<head><title>Session Pradeepkumar.V</title>
<style type="text/css">
<!--
.style1 {
color: #993333;
font-weight: bold;
}
-->
</style>
</head>
<body bgcolor=white >
<form method="GET" action="db.asp" name="UserForm" >
<div align="center" class="style1" >SESSION TRACKING
<br><p >New User Login</p>
</div>
<br><br><br>
<div align="center">
<b>User Name</b>&nbsp;&nbsp; <input type="text" name="user"><br><br>
<b>Password </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password"
name="pass" title="Enter Password" ><br><br>
<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value="Submit">

</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 >

Department of MCA, SMVEC Page 74


<form method="GET" action="aa.asp">
<div align="center" class="style1" >SESSION TRACKING</div>
<A HREF="new.asp">New Login</A>
<br><br><br>
<div align="center">
<b>User Name</b>&nbsp;&nbsp; <input type="text" name="user" title="Enter Your
UserName"><br><br>
<b>Password </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password"
name="pass" title="Enter Password" ><br><br>
<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value="Submit">
</div>
</form>
</body>
</html>
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<%
Response.Expires = 0
%>
<!--ses.asp-->
<HTML>
<HEAD>
<TITLE>Session by Pradeepkumar </TITLE>
</HEAD>
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
<B>Please! Click Visit again to hold the session for few seconds. Logout to view session
details </B></FONT><BR>

<HR SIZE="1" COLOR="#000000">


<%
response.Write("<p>Login :" & session("user1") & "<p>" & "<a
href='upd.asp'>Logout</a>" & "<br><br>")
If (Session("SessionCount") = "") Then
Session("SessionCount") = 0
End If
Session("SessionCount") = Session("SessionCount") + 1
%>
You visited this page
<%= Session("SessionCount") %> times!

<P><A HREF="ses.asp"> visit again</A>


</BODY>
</HTML>

Department of MCA, SMVEC Page 75


<!--aa.asp-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<%
dim us,ps
dim cn
set cn = Server.CreateObject("ADODB.connection")
cn.connectionString="DRIVER={Microsoft Access Driver (*.mdb)};"& "DBQ="&
server.MapPath("ses.mdb")
cn.open
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from ses",cn
us=cstr(request("user"))
ps=cstr(request("pass"))
if us=rs("user") and ps=rs("pass") then
session("user1")=us
session("intim")=Time
response.Redirect("ses.asp")
end if
%>
</body>
</html>
<!--db.asp-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<!--#include file="adovbs.inc"-->
<%
dim us,ps
dim cn
set cn = Server.CreateObject("ADODB.connection")
cn.connectionString="DRIVER={Microsoft Access Driver (*.mdb)};"& "DBQ="&
server.MapPath("ses.mdb")
cn.open
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from ses", cn , Adopendynamic, Adlockoptimistic

Department of MCA, SMVEC Page 76


rs.addnew
us=cstr(request("user"))
ps=cstr(request("pass"))
rs("user")=us
rs("pass")=ps
rs.update
response.Write("Updated Successfully!")
%>
</body>
</html>
<!--upd.asp-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Session by PradeepKumar.V MCA</title>
</head>
<body>
<div align="center"><h1><strong>Session Information</strong></h1></div>
<hr color="#993300" size="2">
<%
dim us,ps,ct,dt,usr,str1
dim cn
set cn = Server.CreateObject("ADODB.connection")
cn.connectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ= " &
server.MapPath("ses.mdb")
cn.open
intim=session("intim")
usr=session("user1")
ct=session("SessionCount")
dt=cstr(Date)
outtim=cstr(time)
Response.Write("User : " & cstr(usr) & "<br>")
Response.Write("Page Count : " & cint(ct) & "<br>")
Response.Write("Date : " & cstr(dt) & "<br>")
Response.Write("In Time : " & cstr(intim) & "<br>")
Response.Write("Out Time : " & cstr(outtim) & "<br>")
str1 = "UPDATE ses SET seshit="&cint(ct)&", dat='"&cstr(dt)&"', intim='"&cstr(intim)&"',
outtim='"&cstr(outtim)&"' where user='"&cstr(usr)&"'"
cn.Execute str1
response.Write("Updated Successfully!")
%>
<hr color="#993300" size="2">
</body>
</html>

Department of MCA, SMVEC Page 77


Session Tracking

Department of MCA, SMVEC Page 78


Department of MCA, SMVEC Page 79
Department of MCA, SMVEC Page 80
<!--emp1.asp-->
<HTML>
<HEAD>
<TITLE> </TITLE>
<style type="text/css">
<!--
body {
background-color: #00ffC31;
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}
.style10 {color: #FFFF00}
-->
</style></HEAD>
<BODY leftmargin="50">
<form method="get" name="frm1" action="db.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><span class="style5">
<span class="style10">Employee Personal Information </span></span></p>
<p>Name&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="name" >
</p>
<p> Email&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="email" >
</p>
<p>
Empno&nbsp;&nbsp;&nbsp;
<input type="text" name="empno">
</p>
<p> Age&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="age">

Department of MCA, SMVEC Page 81


</p>
<p>Gender &nbsp;
<label>
<input name="gender" type="radio" value="Male">
Male</label>
<label>
<input name="gender" type="radio" value="Female">
Female</label>
</p>
<p> Address&nbsp;
<textarea name="address"></textarea>
</p>
<p>Designation
<input type="text" name="desig">
</p>
<p>Basic Sal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="basic">
</p>
<hr color="#003399" size="8">
<div align="center">
<input type="submit" name="Submit" value="Submit" >
</div>
<hr color="#003399" size="8">
</form>
</BODY>
</HTML>

<!--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

Department of MCA, SMVEC Page 82


%>
</body>
</html>
<!--semp1.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" action="pay.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>

Department of MCA, SMVEC Page 83


<span class="style9">Employee Payroll Information ! Enter the details for the Result of
payment </span></span></p>
<p align="center">Employee Number &nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="empno">
</p>
<p align="center">&nbsp; </p>
<hr color="#FF0000" size="3">
<p align="center" class="style12">&nbsp;</p>
<hr color="#003399" size="8">
<div align="center">
<input type="submit" name="Submit" value="Submit" >
</div>
<hr color="#003399" size="8">
</form>
</BODY>
</HTML>

<!--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}

Department of MCA, SMVEC Page 84


.style12 {color: #663333}
.style15 {color: #006600}
-->
</style></HEAD>
<BODY leftmargin="50">

<%
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>&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="empno" value="<%
response.Write(request("empno"))%>">
</p>
<p align="center"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
<hr color="#FF0000" size="3">
<p align="center" class="style12">Enter Mark Details</p>
<p align="center"><span class="style15">Hra</span>

Department of MCA, SMVEC Page 85


<input type="text" name="hra" value="<% response.Write(hra)%>">
</p>
<p align="center"><span class="style15">Da</span>
<input type="text" name="da" value="<% response.Write(da)%>">
</p>
<p align="center"><span class="style15">Cca</span>
<input type="text" name="cca" value="<% response.Write(cca)%>">
</p>
<p align="center"><span class="style15">Pf</span>
<input type="text" name="pf" value="<% response.Write(pf)%>">
</p>
<p align="center"><span class="style15">Net</span>
<input type="text" name="net" value="<% response.Write(net)%>">
</p>
<p align="center">&nbsp;</p>
<hr color="#003399" size="8">
<div align="center">
<input type="submit" name="Submit" value="Submit" >
</div>
<hr color="#003399" size="8">
</form>
</BODY>
</HTML>

<!--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!")

Department of MCA, SMVEC Page 86


%>
</body>
</html>

<!--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

Department of MCA, SMVEC Page 87


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("hra")
da=rs.fields("da")
cca=rs.fields("cca")
pf=rs.fields("pf")
net=rs.fields("net")
exit do
else
rs.movenext()
end if
loop
%>
<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">Payroll Information </span></span></p>
<p align="center"><span class="style10">Empno</span>&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="regno" value="<
%response.Write(rs.fields("empno"))%>">
</p>
<p align="center">&nbsp; </p>
<hr color="#FF0000" size="3">
<p align="center" class="style12">The Result of Payroll</p>
<p align="center">Hra
<input type="text" name="hra" value="<%response.Write(hra)%>">
</p>
<p align="center">Da
<input type="text" name="da" value="<%response.Write(da)%>">
</p>
<p align="center">Cca
<input type="text" name="cca" value="<%response.Write(cca)%>">
</p>
<p align="center">Pf
<input type="text" name="pf" value="<%response.Write(pf)%>">
</p>
<hr color="#FF0000" size="3">
<p align="center">&nbsp;</p>
<p align="center"><span class="style15">Net</span>

Department of MCA, SMVEC Page 88


<input type="text" name="net" value="<%response.Write(net)%>">
</p>
<p align="center">&nbsp; </p>
<p align="center">&nbsp;</p>
<hr color="#003399" size="8">
</form>
</BODY>
</HTML>

Department of MCA, SMVEC Page 89


Employee Information System

Department of MCA, SMVEC Page 90


Department of MCA, SMVEC Page 91
Department of MCA, SMVEC Page 92
Department of MCA, SMVEC Page 93
<!--crt.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" action="db.asp">
<hr color="#660000" noshade="noshade" size="10">
<p align="center" >&nbsp;</p>
<p align="center" ><strong>CRICKET INFORMATION SYSTEM </strong></p>
<p align="center" >&nbsp;</p>
<hr color="#660000" noshade="noshade" size="10">
<p><span >
<span >Cricket Information</span></span></p>
<p>Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;
<input align="absmiddle" type="text" name="name" >
</p>
<p> MaxScore&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input align="absmiddle" type="text" name="score" >
</p>
<p> Wickets&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="wick">
</p>
<p>
Age&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="age">
</p>
<p>Gender &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input name="gender" type="radio" value="Male">
Male</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input name="gender" type="radio" value="Female">
Female</label>
</p>
<p>
Match&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;
<input type="text" name="match">
</p>

<p>Year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;

Department of MCA, SMVEC Page 94


<input type="text" name="year">
</p>
<hr color="#003399" size="8">
<div align="center">
<input type="submit" name="Submit" value="Submit" >
</div>
<hr color="#003399" size="8">
</form>
</BODY>
</HTML>

<!--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" >&nbsp;</p>
<p align="center" ><strong>CRICKET INFORMATION SYSTEM </strong></p>
<p align="center" >&nbsp;</p>
<hr color="#660000" noshade="noshade" size="10">
<div align="center">

Department of MCA, SMVEC Page 95


<table width="469" border="1">
<tr>
<th width="119" scope="col">Name</th>
<th width="45" scope="col">Scores</th>
<th width="55" scope="col">Wickets</th>
<th width="111" scope="col">Match</th>
<th width="105" scope="col">Year</th>
</tr>
<%
dim m1,m2,m3,m4,m5
Set cn = Server.CreateObject("ADODB.Connection")
cn.provider="Microsoft.Jet.OLEDB.4.0"
cn.Mode = adModeReadWrite
cn.open server.MapPath("cricket.mdb")
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select *from cricket",cn
rs.movefirst() %>
<%do while not rs.eof
m1=rs.fields("name")
m2=rs.fields("score")
m3=rs.fields("wick")
m4=rs.fields("match")
m5=rs.fields("year") %>
<tr align="center" valign="middle">
<td><%Response.Write(m1)%></td>
<td><%Response.Write(m2)%></td>
<td><%Response.Write(m3)%></td>
<td><%Response.Write(m4)%></td>
<td><%Response.Write(m5)%></td>
</tr>
<% rs.movenext()
loop
%>
</table>
</div>
</form>
</BODY>
</HTML>

Department of MCA, SMVEC Page 96


Cricket

Department of MCA, SMVEC Page 97


Department of MCA, SMVEC Page 98

Das könnte Ihnen auch gefallen