WEB Manual
WEB Manual
INDEX
Sl
Pa
.
TITLE ge
N
No.
o.
Develop and demonstrate a XHTML document the use of external
3–
1. style sheet, ordered list, table, borders, padding, color and the
6
<span> tag.
Develop and demonstrate a XHTML file that includes JavaScript
script for the following problems:
a) Input: a number n obtained using prompt 7–
2.
Output: The first n Fibonacci numbers. 11
b) Input: A number n obtained using prompt
Output: Numbers 1 to n and their squares, using alert.
Develop and demonstrate a XHTML file that includes JavaScript
script with functions for the following problems:
a) Parameter: a string 12 –
3.
Output: Position in string of leftmost vowel. 16
b) Parameter: a number
Output: The number with its digits in reverse order.
a) Develop and demonstrate, using JavaScript, a XHTML file that
collects the USN(the valid format is: A digit from 1 to 4 followed
by two upper case characters followed by three digits; no
embedded Spaces allowed) of the user. Event handler must be
17 –
4. included for the form element that collects this information to
23
validate the input. Messages in the alert window must be
produced when errors are detected.
b) Modify the above program to get the current semester
also(number between 1 and 8).
a) Develop and demonstrate using JavaScript script, a XHTML
document that contains three short paragraphs Of text, stacked
on top of each other, with only enough of each showing so that
the mouse cursor can be placed over some part of them. When
24 –
5. the cursor is placed over the exposed part of any paragraph, it
29
should rise to the top to become completely visible.
b) Modify the above document so that when a paragraph is moved
from the top stacking position, it returns to its original position
rather than to the bottom.
P a g e |1
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
P a g e |2
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 1
Required Steps
Create an external style sheet with classes defined for the span tag
and <ol>. In the classes for the <span> tag values can be given for
attributes such as color and font weight. The type of ordering (such
as numeric or letters) can be specified for the ordered list, using
the list-style-type attribute.
P a g e |3
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
P a g e |4
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
p1.css:
span.blue{color:lightskyblue;font-weight:bold}
span.green{color:darkolivegreen;font-weight:bold}
ol{list-style-type:upper-roman}
ol ol{list-style-type: upper-alpha}
ol ol ol{list-style-type: decimal;}
P a g e |5
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
CSE ECE
a1 b1 a2 b2
1. CSE
1. Sec A
1. Meenakshi
2. Asma
2. Sec B
1. Adam
2. Sandler
2. ECE
1. Sec A
1. Anne
2. Amy
2. Sec B
1. Peter
2. Sam
P a g e |6
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 2
Required Steps
2a:
Javascript script is embedded within the body of the XHTML file. The
script contains the code to accept the value of n using a prompt.
The first n Fibonacci numbers are then calculated using a do while
loop.
Each number is displayed in the browser window, in order.
2b:
CODE SECTION
P a g e |7
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
2a:
P a g e |8
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
Fibonacci Series:
0
1
1
2
3
5
8
13
21
34
P a g e |9
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
2b:
P a g e | 10
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
PROGRAM 3
P a g e | 11
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
Required Steps
3a:
3b:
CODE SECTION
P a g e | 12
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
3a:
OUTPUT
P a g e | 13
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
P a g e | 14
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
3b:
OUTPUT
P a g e | 15
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 4
Required Steps
4a:
The USN is accepted through a text box. When the submit button is
clicked, the javascript function for checking validity of the USN is
called. The entered USN is compared with the valid pattern defined by
a regular expression. If there is a mistake, an alert message is
displayed saying so, and the USN typed in the textbox is highlighted
so that the user can enter the right USN.
4b:
CODE SECTION
P a g e | 17
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
4a:
</form>
<script type="text/javascript">
P a g e | 18
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
<!--
document.getElementById("myform"). onsubmit=
checkusn;
-->
</script>
</body>
</html>
OUTPUT
P a g e | 19
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
P a g e | 20
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
4b:
P a g e | 21
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
}
-->
</script>
</head>
<body>
<h3>USN & SEM validation</h3><br />
<br />
<form action=" " id="myform">
<p><label>USN:<input type="text" name="text"
id="usn"/></label>
<br />
<label>SEM:<input type="text" name="text"
id="sem" /></label>
<br />
<input type="submit" name="submit" value="SUBMIT" />
</p>
</form>
<script type="text/javascript">
<!--
document.getElementById("myform").onsubmit=
checkusn;
-->
</script>
</body>
</html>
OUTPUT
P a g e | 22
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 5
P a g e | 23
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
Required Steps
P a g e | 24
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
5a:
P a g e | 25
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
5.css:
P a g e | 26
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
P a g e | 27
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
5b:
P a g e | 28
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
P a g e | 29
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 6
Required Steps
6a:
Create an XML document with the details of the students. User defined
tags can be used for each detail such as <usn>, <name>, etc.
Values can be given for the attributes of each of these tags in an
external style sheet.
6b:
An XML file is created for student details as in 6a.
From the set of students, one of them is selected based on the usn
specified. This is done in the xsl file. The details of the selected
student are displayed in a table.
P a g e | 30
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
6a:
P a g e | 31
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
e6a.css:
student{display:block;margin-top:15px;color:blue;}
usn{display:block;color:red;font-weight:bold}
name{display:block;color:brown;}
college{display:block;color:blue;font-weight:bold}
branch{display:block;color:maroon;}
joindate{display:block;color:magenta;font-weight:bold}
emailid{display:block;color:green;}
OUTPUT
P a g e | 32
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
1CR06CS001
Ann
CMRIT
Computer Science
2006
[email protected]
1CR06CS005
Daniel
CMRIT
Computer Science
2006
[email protected]
1CR06CS010
Harry
CMRIT
Computer Science
2006
[email protected]
CODE SECTION
P a g e | 33
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
6b:
s2.xsl:
P a g e | 34
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
<xsl:template match="studentlist">
<table border="1">
<xsl:for-each select="key('student-by-usn', '1CR06CS001')">
<tr>
<td>
<xsl:value-of select="usn" />
</td>
<td>
<xsl:value-of select="name" />
</td>
<td>
<xsl:value-of select="college" />
</td>
<td>
<xsl:value-of select="branch" />
</td>
<td>
<xsl:value-of select="joindate" />
</td>
P a g e | 35
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
<td>
<xsl:value-of select="emailid" />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
OUTPUT
P a g e | 36
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 7
P a g e | 37
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
Required Steps
7a:
7b:
P a g e | 38
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
7a:
CGI file
#!/usr/bin/perl
use strict;
use CGI':standard';
print
header(),
start_html(-bgcolor=>'silver'),
hr(),
"<h2>SERVER INFORMATION</h2>",
hr(),
"Serevr Name:",$ENV{'SERVER_NAME'},
br(),
"Server Software:",$ENV{'SERVER_SOFTWARE'},
br(),
"Server Protocol:",$ENV{'SERVER_PROTOCOL'},
br(),
"server port:",$ENV{'SERVER_PORT'},
br(),
"CGI Revision",$ENV{'GATEWAY_INTERFACE'},
br(),
end_html();
P a g e | 39
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
P a g e | 40
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
7b:
HTML file
<html>
<body>
<hr>
<h2>UNIX COMMAND</h2>
<form action="/cgi-bin/7b.cgi">
<input type="text" name="cmd">
<input type="submit" value="submit">
</form>
</body>
</html>
CGI file
#!/usr/bin/perl
use strict;
use CGI':standard';
my $cmd=param('cmd');
chomp($cmd=`/bin/$cmd`);
print
header(),
start_html(-bgcolor=>'pink','RESULT'),
hr(),
"<h2>Executing command</h2>",
hr(),
br(),
"$cmd"||"INVALID COMMAND",
br(),
hr(),
end_html();
P a g e | 41
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
P a g e | 42
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 8
Required Steps
8a:
8b:
P a g e | 43
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
8a:
HTML file
<html>
<head><title>Greeting message</title></head>
<body bgcolor=pink>
<hr>
<h2>Greeting</h2>
<hr><br>
<form name=hi action="/cgi-bin/8a.cgi" method="post">
Enter ur name <input type="text" name="name" size=20><br><br>
Greeting type:
<select name="greet" size="4" multiple>
<option>Good morning</option>
<option>Good after noon</option>
<option>Good evening</option>
<option>Good night</option>
</select>
<input type="submit" value="submit"><br><hr>
</form>
</html>
CGI file
#!/usr/bin/perl
use strict;
use CGI':standard';
my $name;
my $greeting;
$name=param('name');
$greeting=param('greet');
print
header(),
start_html(-bgcolor=>'orange','RESULT'),
hr(),
"<h2>Displaying Greeting message</h2>",
hr(),
br(),
"$greeting $name",
hr(),
end_html();
P a g e | 44
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
P a g e | 45
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
8b:
HTML file
<html>
<body bgcolor=red>
<hr><h1>VISITORS COUNT</h1>
<form action="/cgi-bin/8b.cgi">
<br><input type="submit" value="submit"><br></form>
</body>
</html>
CGI file
#!/usr/bin/perl
use strict;
use CGI':standard';
my $line;
my $count;
open(FH,'<test2.txt')or die"can't open";
while($line=<FH>)
{
$count=$line;
}
close(FH);
$count++;
$line=$count;
open(FH,'>test2.txt')or die"cant't";
while($count)
{
print FH"$count\n";
$count=0;
}
close(FH);
print
header(),
start_html(-bgcolor=>'gray'),
hr(),
"<h1>Visitors count</h1>",
hr(),br(),br(),
"you r the $line user",
hr(),br(),br(),
end_html();
P a g e | 46
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
P a g e | 47
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 9
Required Steps
P a g e | 48
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
HTML file
<html>
<head><title>Displaying Digital Clock</title>
</head><body bgcolor=pink>
<form action="/cgi-bin/9.cgi">
<hr><br><b><center>DIGITAL CLOCK</center></b>
<hr><br>
<center><input type="submit" value="DISLAY CLOCK"><br>
<br><hr>
</center></form>
</body></html>
CGI file
#!/usr/bin/perl
use strict;
use CGI':standard';
my $ampm;
my($sec,$min,$hour)=localtime(time);
if($hour>12)
{
$hour=$hour-12;
$ampm="PM";
}else
{
$ampm="AM";
}
print
header(),
start_html(-bgcolor=>'pink'),
<<EOHTML;
<head>
<META HTTP-EQUIV="Refresh" CONTENT="1">
<center><hr><b><h1>$hour:$min:$sec:$ampm</h1><b></center><hr>
</head>
EOHTML
end_html();
P a g e | 49
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
On clicking the DISPLAY CLOCK button, a new page with time opens:
P a g e | 50
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 10
Required Steps
P a g e | 51
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
HTML file
<html>
<body>
<form action="/cgi-bin/a10.cgi">
Name : <input type="text" name="name"> <br>
Age :<input type="text" name="age"> <br>
<input type="submit" value="Submit">
</form>
</html>
CGI file
#! /usr/bin/perl
while ( ($name,$age)=$qh->fetchrow())
{
print "<tr><td>$name</td><td>$age</td></tr>";
}
print "</table>";
$qh->finish();
$dbh->disconnect();
print"</HTML>";
P a g e | 52
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
PROGRAM 11
P a g e | 53
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
Required Steps
CODE SECTION
P a g e | 54
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PHP file
<?
// get current date information as associative array
if(isset($_COOKIE['Datee']))
{
$cookiedate = $_COOKIE['Datee'];
}
$todayh = getdate();
$d = $todayh[mday];
$m = $todayh[mon];
$y = $todayh[year];
$hr = $todayh[hours];
$mi = $todayh[minutes];
$se = $todayh[seconds];
$datestring ="$d-$m-$y, $hr:$mi:$se";
setcookie("Datee",$datestring);
print "Program for creating and displaying cookie";
print"<br>";
echo "<br>Hello, ".$cookiedate."! last visited!";
print"<br>";
?>
OUTPUT
P a g e | 55
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
On refreshing:
P a g e | 56
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 12
Required Steps
P a g e | 57
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
PHP file
<?php
session_start();
if(isset($_SESSION['count']))
{
print "Your session count: ".$_SESSION['count']. "<br>";
$_SESSION['count']++;
} else {
$_SESSION['count'] = 1;
print "Session does not exist";
}
?>
P a g e | 58
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
On Refresh:
On refreshing again:
P a g e | 59
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 13
Required Steps
P a g e | 60
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
HTML file
<html>
<head>
<title> Database Access using PHP </title>
</head>
<body>
<form action="/php/prg13.php" method="post">
ID: <input type="text" name="id" /><br />
Name: <input type="text" name="name" /><br />
Address1: <input type="text" name="addr1" /><br />
Address2: <input type="text" name="addr2" /><br />
Email: <input type="text" name="email" /><br /><br />
Enter the student's name to retreive data: <input type="text"
name="sname" /><br />
<input type="submit" value="submit">
</form>
</body
</html>
P a g e | 61
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PHP file
<?php
$id=$_POST['id'];
$name=$_POST['name'];
$addr1=$_POST['addr1'];
$addr2=$_POST['addr2'];
$email=$_POST['email'];
$sname=$_POST['sname'];
mysql_connect('localhost','root', '');
mysql_select_db("student") or die("Unable to select
database");
$insertquery="INSERT INTO personinfo
VALUES('$id','$name','$addr1','$addr2','$email')";
mysql_query($insertquery);
$selectquery="SELECT * FROM personinfo where Name='$sname'";
$result=mysql_query($selectquery);
$numrows=mysql_numrows($result);
print "<table border size=1> <tr><th>ID</th><th>Name</th>
<th>Address1</th><th>Address2</th><th>Email</th></tr>";
$rownum=0;
while($rownum<$numrows)
{
$row=mysql_fetch_array($result);
print "<tr><td>".$row['ID']."</td><td>".$row['Name']."</td>
<td>".$row['Address1']."</td><td>".$row['Address2']."</td>
<td>".$row['email']."</td></tr>";
$rownum++;
}
print "</table>";
mysql_close();
?>
P a g e | 62
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
OUTPUT
P a g e | 63
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
PROGRAM 14
Required Steps
P a g e | 64
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
CODE SECTION
HTML file
<html>
<head>
<title> Accessing Book Database </title>
</head>
<body>
<form action="/php/prg14.php" method="post">
Accession Number: <input type ="text" name="accno" />
<br />
Title: <input type ="text" name="title" /><br />
Authors: <input type ="text" name="author" /><br />
Edition: <input type ="text" name="edition" /><br />
Publisher: <input type ="text" name="publish" /><br />
Search for a book with Title: <input type ="text"
name="search" /><br />
<input type="submit" /> <input type="reset" />
</form>
</body>
</html>
PHP file
<?php
$accno=$_POST['accno'];
$title=$_POST['title'];
$author=$_POST['author'];
$edition=$_POST['edition'];
$publish=$_POST['publish'];
$search=$_POST['search'];
mysql_connect('localhost','root', 'uma');
mysql_select_db("BookDealer") or die("Unable to select
database");
$insertquery="INSERT INTO Bookinfo
VALUES('$accno','$title','$author','$edition','$publish')";
mysql_query($insertquery);
$selectquery="SELECT * FROM Bookinfo where title like
'%$search%'";
$result=mysql_query($selectquery);
P a g e | 65
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
$numrows=mysql_numrows($result);
if ($numrows==0)
die("Sorry No matches found");
else
{
print "<table border size=1> <tr><th>AccessionNo</th>
<th>Title</th> <th>Authors</th><th>Edition</th>
<th>Publications</th></tr>";
while($row=mysql_fetch_row($result))
{
print "<tr><td>$row[0]</td><td>$row[1]</td>
<td>$row[2]</td><td>$row[3]</td><td>$row[4]</td></tr>";
}
print "</table>";
}
mysql_close();
?>
OUTPUT
P a g e | 66
Signature of the Staff:
Date:
Dept of Computer Science & Engineering, CMRIT.
WEB PROGRAMMING LABORATORY (06CSL78)
P a g e | 67
Signature of the Staff:
Date: