WAS Printouts PDF
WAS Printouts PDF
home.html
<frameset rows="40%,*">
top.html
<html>
<head>
<title>Top Frame</title>
</head>
<body bgcolor="YellowGreen">
<img src="images/logo1.png" width="125" height="115" align="left">
<img src="images/cse.png" width="125" height="115" align="right">
<center>
<marquee bgcolor="yellow" width="650" behavior="alternate">
<font face="Brush Script MT" size="8" color="green"><b><i>Online Book Store</i></b></font>
</marquee>
<br>
<font face="Brush Script" size="6" color="white"><b>Created & Maintained By MRCET</b></font>
</center>
<br>
<table width="100%" height="50%" cellspacing="10">
<tr align="center">
<td><a href="Home.html" target="_parent"><font face="Brush Script" size="6"
color="navy">HOME</a></td>
<td><a href="login.html" target="rightframe"><font face="Brush Script" size="6"
color="navy">LOGIN</a></td>
<td><a href="registration.html" target="rightframe"><font face="Brush Script" size="6"
color="navy">REGISTER</a></td>
<td><a href="catalogue.html" target="rightframe"><font face="Brush Script" size="6"
color="navy">CATALOGUE</a></td>
</tr>
</table>
</body>
</html>
left.html
<html>
<body align="center" bgcolor="bisque">
<br>
<a href="cse.html" target="rightframe"><font size="6">CSE</font></a><br><br>
<a href="ece.html" target="rightframe"><font size="6">ECE</font></a><br><br>
<a href="eee.html" target="rightframe"><font size="6">EEE</font></a><br><br>
<a href="mech.html" target="rightframe"><font size="6">MECH</font></a><br>
</body>
</html>
right.html
<html>
<body bgcolor="orange">
<center>
<img src="images/Books.jpg" height="170"><br>
<font face="Brush Script MT" size="5" color="blue">
<h1><b>Welcome to the Online Book Store!!!</b></h1>
</font>
<font face="Brush Script MT" size="5" color="red">
<h2><b>"A Huge Collection Of Engineering E-Books"</b></h2>
</font>
</center>
</body>
</html>
cse.html
<html>
<head><title>CSE</title></head>
<body bgcolor="cyan">
<center><font color="blue"><h1>Computer Science and Engineering</h1></font></center>
<br>
<table align="center">
<tr>
<td>Text Books</td>
<td>
<select>
<option value="select the book" selected>Select the book</option>
<option value="C&Ds">C&Ds</option>
<option value="Ads">Ads</option>
<option value="Java">Java</option>
<option value="Oracle">Oracle</option>
<option value="Ms SQL Server">Ms SQL Server</option>
<option value="MySql">MySql</option>
</select>
</td>
</tr>
<tr>
<td>Quantity</td>
<td><input type="text" id="q"></td>
</tr>
<tr>
<td></td>
<td>
<form method="post" action="order.html">
<input type="submit" value="ok" />
</form>
</td>
</tr>
</table>
<center>
<pre>Cost of one book is 500 + shipping 100</pre>
</center>
</body>
</html>
ece.html
<html>
<body bgcolor="Plum">
<h1><font color="blue">Electronics and Communication Engineering</font></h1>
<h2>
<ul>
<li>Digital Circuits</li>
<li>Signals and Systems</li>
<li>Digital Communication</li>
</ul>
</h2>
</body>
</html>
eee.html
<html>
<body bgcolor="Plum">
<h1><font color="blue">Electrical and Electronics Engineering</font></h1>
<h2>
<ul type="square">
<li>Concepts in Electric Circuits</li>
<li>Introduction to Electronic Engineering</li>
<li>Electrical Power</li>
</ul>
</h2>
</body>
</html>
mech.html
<html>
<body bgcolor="Plum">
<h1><font color="blue">Mechanical Engineering</font></h1>
<h2>
<ol type="I">
<li>Theory of Machines</li>
<li>Automation and Robotics</li>
<li>Engineering Fluid Mechanics</li>
</ol>
</h2>
</body>
</html>
catalogue.html
<html>
<head>
<title>Catalogue</title>
</head>
<body bgcolor="pink">
<form action="order.html">
<table border="1" width="100%">
<tr>
<td><img src="images/wt.jpg" width="100" height="100"></td>
<td>Book: Web Technologies <br> Author: Uttam K. Roy <br> Publication: Oxford University Press</td>
<td>531</td>
<td><input type="submit" value="Add to cart"></td>
</tr>
<tr>
<td><img src="images/php.jpg" width="100" height="100"></td>
<td>Book: PHP & MySQL Web Development <br> Author: Luke Welling & Laura Thompson <br>
Publication: PEARSON</td>
<td>898</td>
<td><input type="submit" value="Add to cart"></td>
</tr>
</table>
</form>
</body>
</html>
login.html
<html>
<body bgcolor="pink">
order.html
<html>
<head><title>Order Confirmation</title></head>
<body bgcolor="cyan">
<center>
<pre><strong><b>Your order is confirmed</b></strong></pre>
<h2><b>THANK YOU... Visit Again</b></h2>
</center>
</body>
</html>
EXPERIMENT 02: Write JavaScript to validate the following fields of the
Registration page.
registeration.html
<html>
<head>
<script type='text/javascript'>
function formValidator() {
isAlphanumeric(pass, "Please enter Numbers and Letters Only for password") &&
notEmpty(addr, "Please enter the address") &&
return false;
alert(helperMsg);
return true;
if (elem.value.match(numericExpression)) {
return true;
} else {
alert(helperMsg);
elem.focus();
return false;
if (elem.value.match(alphaExp)) {
return true;
} else {
alert(helperMsg);
elem.focus();
return false;
return true;
} else {
alert(helperMsg);
elem.focus();
return false;
return true;
} else {
elem.focus();
return false;
if (elem.value.match(emailExp)) {
return true;
} else {
alert(helperMsg);
elem.focus();
return false;
return true;
} else {
alert("Please enter " + min + " numbers only");
elem.focus();
return false;
</script>
</head>
<body bgcolor="#E4F0F8">
<center>
<br />
Address<font color="red">*</font>
<textarea rows="2" cols="20" id='addr'></textarea><br /><br />
</form>
</body>
</html>
EXPERIMENT 03: Develop and demonstrate the usage of inline, internal and
external style sheet using CSS
style.css:
css
Copy
p.left {
text-align: left;
color: blue;
font-family: Cambria;
font-size: large;
text-indent: 20px;
}
p.center {
text-align: center;
text-decoration: underline;
text-transform: uppercase;
letter-spacing: -3px;
word-spacing: 20px;
font-size: larger;
}
p.right {
text-align: right;
color: red;
font-family: Tahoma;
font-size: 15pt;
text-decoration: overline;
font-style: italic;
}
b#headline {
color: orange;
font-size: 22px;
font-family: Arial;
text-decoration: underline;
}
sample.html:
html
Copy
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
background-image: url('images/cse.png');
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
background-color: pink;
}
a:link {
text-decoration: none;
color: orange;
}
a:visited {
text-decoration: none;
color: red;
}
a:hover {
text-decoration: underline;
color: blue;
}
a:active {
text-decoration: underline;
color: purple;
}
h3 {
color: green;
}
.c1 {
cursor: crosshair;
}
.c2 {
cursor: pointer;
}
.c3 {
cursor: move;
}
.c4 {
cursor: text;
}
.c5 {
cursor: wait;
}
.c6 {
cursor: help;
}
</style>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="cyan">
<h1 style="color:blue; text-align:center;">CSS (Inline, Internal and External)</h1>
date.html:
<html>
<body>
<script>
function display() {
factorial.html:
<html>
<head>
<title>Factorial</title>
<script language="javascript">
function factorialcalc() {
var number = parseInt(prompt("Enter a number, I'll calculate its factorial", "Whole numbers greater
than zero, please"));
var factorial = 1;
for (var i = 1; i <= number; i++) {
factorial = factorial * i;
}
alert("The factorial of " + number + " is " + factorial);
}
</script>
</head>
<body>
<form name="frm">
<input type="button" value="Factorial" onclick="factorialcalc();" />
</form>
</body>
</html>
multable.html:
<html>
<head><title>Multiplication Table</title></head>
<body>
<script type="text/javascript">
var n = prompt("Enter positive value for n: ");
if (!isNaN(n) && n > 0) {
var table = "";
var number = "";
for (var i = 1; i <= 10; i++) {
number = n * i;
table += n + " * " + i + " = " + number + "\n";
}
alert(table);
} else {
alert("Please enter a valid positive number.");
}
document.write(n + " table values displayed using alert..<br />");
</script>
</body>
</html>
sum of n numbers.html:
<html>
<head><title>Sum of N Numbers using Popup Boxes</title>
<script language="javascript">
function addsum() {
alert("You're going to give me a list of numbers. I'm going to add them together for you.");
var keepgoing = true;
var sumofnums = 0;
while (keepgoing) {
sumofnums = sumofnums + parseInt(prompt("What's the next number to add?", ""));
keepgoing = confirm("Add another number?");
}
alert("The sum of all your numbers is " + sumofnums);
}
</script>
</head>
<body>
<form name="frm">
<input type="button" value="Sum of N Numbers" onclick="addsum();" />
</form>
</body>
</html>
EXPERIMENT 05: Write an HTML page that contains a selection box with a list
of 5 countries. When the user selects a country, its capital should be printed
next in the list. Add CSS to customize the properties of the font of the capital
(color,bold and font size).
countries.html
<html>
<head>
<style>
h1 {
color: red;
text-align: center;
}
.textbox1 {
color: blue;
font-size: 30px;
font-weight: bold;
}
</style>
</head>
<body>
<center>
<form name="myform">
Select Country
DELHI">INDIA</option> <option
value="CANBERRA">AUSTRALIA</option> <option
value="WASHINGTON D.C">AMERICA</option> <option
</select><br><br>
Capital
<input type="text" class="textbox1" id="sbox2" readonly>
</form>
</center>
<script>
function myFunction() {
var a = document.getElementById("sbox1").value;
document.getElementById("sbox2").value = a;
</script>
</body>
</html>
EXPERIMENT 06: Develop and demonstrate PHP Script for the following
problems:
• Write a PHP Script to find out the Sum of the Individual Digits.
Write a PHP Script to check whether the given number is Palindrome or not
sum.php
<?php
$sum = 0;
?>
palindrome.php
<?php
$n = 323; // Example number
}
echo "Reversed number is: $rev <br>";
if ($t == $rev) {
} else {
?>
EXPERIMENT 07: Write a XML program to validate student details (Rno,
Name, college & branch) using DTD
student1.xml
<?xml version="1.0"?>
<!-- student1.xml -->
<students>
<student>
<name>
<firstname>James</firstname>
<lastname>Smith</lastname>
</name>
<address>
<email>[email protected]</email>
<phone>4940001</phone>
</address>
</student>
<student>
<name>
<firstname>Tom</firstname>
<lastname>White</lastname>
</name>
<address>
</address>
</student>
</students>
student2.xml
<?xml version="1.0"?>
<students>
<student>
<name>
<firstname>James</firstname>
<lastname>Smith</lastname>
</name>
<address>
<city>Halifax</city>
<email>[email protected]</email>
<phone>4940001</phone>
</address>
<college>Dalhousie University</college>
<branch>Computer Science</branch>
</student>
<student>
<name>
<firstname>Tom</firstname>
<lastname>White</lastname>
</name>
<address>
<city>Dartmouth</city>
<email>[email protected]</email>
<phone>4940002</phone>
</address>
<college>Dalhousie University</college>
<branch>Electrical Engineering</branch>
</student>
</students>
students.dtd
<?xml version="1.0"?>
date.php
<?php
// Set the default timezone
date_default_timezone_set("Asia/Calcutta");
// Display the current date in day/month/year format
echo "Date: ";
echo date("d/m/y");
echo "<br>";
echo "<br>";
<title>VoterApp</title>
</head>
<body>
<form action="http://localhost:8080/CheckAge/check" method="get">
<fieldset style="width:20%; background-color:#80ffcc">
<table>
<tr>
<td>Name</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>Age</td>
<td><input type="text" name="age"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Check Eligibility"></td>
</tr>
</table>
</fieldset>
</form>
</body>
</html>
<servlet-mapping>
<servlet-name>abc</servlet-name>
<url-pattern>/check</url-pattern>
</servlet-mapping>
</web-app>
Vivek
test.jsp
<html>
<head>
<title>JSP Application</title>
</head>
<body>
<form>
<fieldset style="width:50%; background-color: #ccffeb;">
<legend><b><i>JSP Application</i></b></legend>
<h3>Current Date and Time is:</h3>
<%
// Get the current date and time
java.util.Date d = new java.util.Date();
// Print the current date and time
out.println(d.toString());
%>
</fieldset>
</form>
</body>
</html>
EXPERIMENT 09: Implement the web applications with Database using (a)
PHP, (b) Servlets and (c) JSP.
<html>
<body>
<?php
$servername = "localhost";
$username = "root";
$password = "TIGER";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully <br>";
// Create database
$sql = "CREATE DATABASE reg";
if (mysqli_query($conn, $sql)) {
echo "Database created successfully<br>";
} else {
echo "Error creating database: " . mysqli_error($conn);
}
$servername = "localhost";
$dbname = "reg";
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected to database successfully <br>";
// Close connection
mysqli_close($conn);
?>
</body>
</html>
<html>
<head>
<title>Login Page</title>
</head>
<body>
<center>
<h1>Login Page</h1>
<form action="loginform.php" method="post">
<table>
<tr>
<td><label>Name:</label></td>
<td><input type="text" name="uname" /></td>
</tr>
<tr>
<td><label>Password:</label></td>
<td><input type="password" name="upwd" /></td>
</tr>
<tr>
<td><input type="submit" value="Submit" /></td>
<td><input type="reset" value="Reset" /></td>
</tr>
</table>
</form>
</center>
</body>
</html>
<html>
<head>
<title>Registration page</title>
</head>
<body>
<?php
$name = $_POST["uname"];
$pwd = $_POST["upwd"];
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
try {
// Register JDBC driver
Class.forName("com.mysql.jdbc.Driver");
// Open a connection
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
// Execute a query
Statement stmt = conn.createStatement();
String sql = "SELECT * FROM Emp";
ResultSet rs = stmt.executeQuery(sql);
// Extract data from result set
while (rs.next()) {
out.println("ID: " + rs.getString(1));
out.println("Age: " + rs.getString(2));
out.println("First Name: " + rs.getString(3) + "<br>");
}
// Clean-up environment
rs.close();
stmt.close();
conn.close();
} catch (SQLException se) {
// Handle errors for JDBC
out.println(se.getMessage());
} catch (Exception e) {
// Handle errors for Class.forName
out.println(e.getMessage());
}
out.println("</body></html>");
}
}
<servlet-mapping>
<servlet-name>DBExample</servlet-name>
<url-pattern>/db</url-pattern>
</servlet-mapping>
</web-app>
while (rs.next()) {
out.println(rs.getInt(1) + " " + rs.getString(2) + " " + rs.getString(3) + "<br>");
}
con.close();
} catch (Exception e) {
out.println(e);
}
%>
</body>
</html>
Vivek
Vivek