Professional Documents
Culture Documents
Web Manual PDF
Web Manual PDF
1. Develop and demonstrate a XHTML document that illustrates the use external style
sheet, ordered list, table, borders, padding, color, and the tag.
Prg1.html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC="-/W3C//DTD XHTML 1.1//EN"
http://www.w3.org/TR/xhtml 1.1/DTD/xhtml11.dtd>
<html xmlns="http://www.w3.org/1999</xhtml">
<head>
<title>program1</title>
<link rel="stylesheet" type="text/css" href="prg1a.css" />
</head>
<body bgcolor="aqua">
<p>ordered list </p>
<ol>
<li>india</li>
<li>pakistan</li>
<li>china</li>
</ol>
<table cellspacing="6" cellpadding=5 border="6">
<tr>
<th> </th>
<td style="color:green">GOLD</td>
<td style="color:red">SILVER</td>
<td style="color:blue">BRONZE</td>
</tr>
<tr>
<td style="color:green">INDIA</td>
<td>0</td>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td style="color:yellow">CHINA</td>
<td>0</td>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td style="color:red">JAPAN</td>
<td>1</td>
CSE, CITECH
Page 1
CSE, CITECH
Page 2
CSE, CITECH
Page 3
CSE, CITECH
Page 4
CSE, CITECH
Page 5
CSE, CITECH
Page 6
CSE, CITECH
Page 7
CSE, CITECH
Page 8
CSE, CITECH
Page 9
OUTPUT:
CSE, CITECH
Page 10
CSE, CITECH
Page 11
OUTPUT:
Hi welcome to Bangalore
Hi welcome to
CEC
Welcome
to ISE
Dept.
CSE, CITECH
Page 12
CSE, CITECH
Page 13
Welcome to CEC
ISE
CSE, CITECH
Page 14
CSE, CITECH
Page 15
CSE, CITECH
Page 16
CSE, CITECH
Page 17
7. a) Write a Perl program to display various Server Information like Server Name, Server
Software, Server protocol, CGI Revision etc.
Prg7a.html
<html>
<head><title>Server info</title></head>
<body>
<form action="http://localhost/cgi-bin/prg7a.pl" method="post">
<h1>Server info display pgm</h1>
<input type="submit" value="click here to see info">
</form>
</body>
</html>
Prg7a.pl
#!/usr/bin/perl
print"content-type:text/html","\n\n";
printf"<html><body> <h1 align=center> server information </h1> <br />";
print"<h3><br>server name:- ",$ENV{'SERVER_NAME'};
print"<br> RUNNING PORT:- ",$ENV{'SERVER_PORT'};
print"<br> SERVER PROTOCOL:- ",$ENV{'SERVER_PROTOCOL'};
print"<br> SERVER SOFTWARE:- ",$ENV{'SERVER_SOFTWARE'};
print"<br> GATEWAY INTERFACE:- ",$ENV{'GATEWAY_INTERFACE'};
print"<br> </h3> </body> </html>";
OUTPUT:
SERVER INFORMATIOM
SERVAER NAME: localhost
SERVAER PORT: 80
SERVAER PROTOCOL: HTTP/1.1
SERVAER SOFTWARE: Apache/2.2.12
GATEWAY INTERFACE: CGI
CSE, CITECH
Page 18
CSE, CITECH
Page 19
HI!
GOOD DAY..!!
visit soon.
8 b) Write a Perl program to keep track of the number of visitors visiting the web page and
to display this count of visitors, with proper headings
prg8b.pl
#!/usr/bin/perl
print"Content-type:text/html","\n\n";
print "<html><body><h1>no of visits to this page....</h1><br />";
$file='color.txt';
open(INFO,$file);
$n=<INFO>;
close(INFO);
print"<h1>$n</h1>";
open INFO,">color.txt";
print INFO ++$n;
close INFO;
print "<br></body></html>";
OUTPUT:
Number of Visits to this Page 5
CSE, CITECH
Page 20
CSE, CITECH
Page 21
CSE, CITECH
Age
22
21
13
Page 22
12. Write a PHP program to store page views count in SESSION, to increment the count on
each refresh, and to show the count on web page.
Prg12.php
<?
session_start();
session_register("count");
if(!isset($_SESSION))
{
$_SESSION["count"]=0;
echo "<p>counter initiazed</p>\n";
}
else {$_SESSION["count"]++;}
echo "<p>the counter is now <b>$_SESSION[count]</b></p>","<p>reload this page to
increment</p>";
?>
OUTPUT:
The Counter is now 12
Reload this page to increment
CSE, CITECH
Page 23
CSE, CITECH
Page 24
CSE, CITECH
Page 25
Prg13b.php
<?php
$name=$_GET['name'];
$mysql=mysql_connect("localhost","root","") or die("cannot connect");
$query="select * from student where name='$name'";
$result=mysql_db_query("CEC",$query) or die("error in the query");
print"<html><body bgcolor='black' text='yellow'>
<h1><marquee>program#13</marquee></h1>
<center><h3>XHTML Document to use of PHP & MYSQL</h3>
<h4>City Engineering College</h4>
<h5>Dept of Computer Science and engineering</h5></center>";
if(mysql_num_rows($result)==0)
echo "no record found";
else
{
while($array=mysql_fetch_row($result))
{
foreach($array as $f)
print " $f ";
print"<br>";
}
}
print"</body></html>";
mysql_close($mysql);
?>
CSE, CITECH
Page 26
Address1
Address2
Bangalore Karnataka
Email-id
sow@gmail.com
14. Using PHP and MySQL, develop a program to accept book information viz. Accession
number, title, authors, edition and publisher from a web page and store the information in
a database and to search for a book with the title specified by the user and to display the
search results with proper headings.
Prg14.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
<title> Mysql </title>
</head>
<body bgcolor="pink" text="yellow" >
<h1> <marquee> Program #14 </marquee> </h1>
<center><h3>XHTML Document to use of PHP & MYSQL</h3>
<h4>City Engineering College</h4>
<h5>Dept. of Computer Science and Engineering</h5> </center>
<hr>
<h1 align="center"> Form to insert values into table </h1>
<form action="prg14a.php">
<table border="1" align="center">
<tr><td> ACCESSION NUMBER:</td>
<td> <input type="text" id="accno" name="accno"/> </td>
</tr>
<tr>
<td> TITLE:</td>
<td> <input type="text" id="tit" name="tit"/> </td>
</tr>
<tr> <td> AUTHOR:</td>
<td> <input type="text" id="aut" name="aut"/> </td>
</tr>
<tr> <td> EDITION:</td>
<td> <input type="text" id="edi" name="edi"/> </td>
</tr>
CSE, CITECH
Page 27
CSE, CITECH
Page 28
CSE, CITECH
Page 29
CSE, CITECH
Page 30