OSS LAB MANUAL (FINAL)[1]
OSS LAB MANUAL (FINAL)[1]
Recognized by UGC under section 2(f) and 12 (b) of the UGC Act 1956,
Permanently affiliated with Thiruvalluvar University and Approved by the
Govt of Tamilnadu,
Accredited by the NAAC with “B” Grade
VANIYAMBADI, TIRUPATTUR DIST.
2023-2024
NAME :
REGISTER NUMBER :
CLASS :
ISLAMIAH WOMEN’S ARTS AND SCIENCE
COLLEGE
Recognized by UGC under section 2(f) and 12 (b) of the UGC Act 1956, Permanently
affiliated with Thiruvalluvar University and Approved by the Govt of Tamilnadu,
Accredited by the NAAC with “B” Grade
VANIYAMBADI, TIRUPATTUR DIST.
Subject:
CERTIFICATE
Bonafide record of work done in the Computer Centre of Islamiah Women’s Arts and
Science College, during the year 2023 – 2024.
1
EX NO: 01 CREATING A WEBPAGE WITH FRAMES AND TABLES
DATE:
AIM:
To write a Html program for creating web pages with frames and tables.
ALGORITHM:
STEP2: Type the program for frameset and save a file with homepage.html.
STEP3: Type the program for top frame and save a file with topframe.html.
STEP4: Type the program for right frame and save a file with right frame.html.
STEP5: Type the program for left frame and save a file with leftframe.html.
STEP6:Type the program for top frame and save a file with login.html.
STEP7:Type the program for top frame and save a file with register.html.
STEP8:Type the program for table and save a file with cart.html.
STEP5:Type the program for left frame and save a file with bba.html.
STEP6:Type the program for left frame and save a file with bca.html.
STEP5:Type the program for left frame and save a file with bsc.html.
STEP6:Type the program for left frame and save a file with bio.html.
2
PROGRAM:
HOMEPAGE
<html>
<head>
<title>Book Store</title></head>
<frameset rows="20%,*">
<frameset cols="20%,*">
</frameset>
</frameset>
</html>
TOPFRAME:
<html>
<body bgcolor=#bbffbb>
<th width="14%">
</th>
3
<th><a href="rightframe.html" target="f3">Home</a></th>
<th><a href="login.html" target="f3">login</a></th>
<th><a href="register.html" target="f3">registration</a></th>
<th><a href="catalogue.html" target="f3">Catalogue</a></th>
<th><a href="cart.html" target="f3">Cart</a></th>
</tr>
</table>
</body>
</html>
RIGHT FRAME:
<html>
<body bgcolor="white">
<p>
<h3>
</p>
</body>
</html>
LEFTFRAME
<html>
<body>
<center>
<a href=BSC.html target="f3"><h3>BSC</h3></a><br><br><br><br><br>
<a href=BCA.html target="f3"><h3>BCA</h3></a><br><br><br><br><br>
<a href=BBA.html target="f3"><h3>BBA</h3></a><br><br><br><br><br>
<a href=BIO.html target="f3"><h3>BIO</h3></a><br><br><br><br><br>
4
</center>
</body>
</html>
CATALOGUE
<html>
<head>
<title>Catalogue</title>
</head>
<body bgcolor="pink">
<form>
<table border="1" width="100%">
<tr>
<td><img src="java.jpg" width=100 height=100/></td>
<td> Book:Java Programming<br>Author:P.Rizwan Ahmed<br>
Margham publication,Chennai.</td>
<td>Rs.150 </td><td>
<input type="button" value="Add to cart"/></td></tr>
<tr><td><img src="internet.jpg" width=100 height=100/></td>
<td>Book:Internet and its Applications<br>
Author:P.Rizwan Ahmed<br>Margham Publication,Chennai.</td>
<td>Rs.140 </td>
<td>
<input type="button" value="Add to Cart"/></td>
</tr>
</table>
</form>
</body>
</html>
CART
<html>
<body>
<center><br><br><br>
<table border=1 cell padding=center>
<thread>
<tr>
<th>Book name</th>
5
<th>Price</th>
<th>Quantity</th>
<th>Amount</th>
</tr>
</thread>
<tr>
<td>java programming</td>
<td>$45</td>
<td>2</td>
<td>$70</td>
</tr>
<tr>
<td>Internet and its application</td>
<td>$20</td>
<td>5</td>
<td>$40</td>
</tr>
<th cols pan=4>total amount=$110
</th>
</table>
</center>
</body>
<html>
REGISTER
<html>
<head>
<title>New User!</title>
</head>
<body>
<form><center><h1><font size="3">Registration Form</font></h1>
<hr width="50%">
6
Email Id: <input type="text" maxlength=15 size=25/><br/><br/>
Address: <textarea rows=5 cols=30></textarea><br/><br/>
<input type="submit" value="Submit"/>
<input type="reset" Value="Reset"/>
</form>
</body>
</html>
LOGIN
<html>
<head>
<title>Login</title>
</head>
<body bgcolor="pink">
<center>
<form> <b>Login:
<input type="text" name="login"/><br><br>
Password:<input type="password" name="password"/><br><br>
<input type="submit" value="Submit"/>
<input type="reset" value="Reset"/></b>
</form>
</center>
</body>
</html>
BSC.html
<html>
<body bgcolor="cyan">
BookList<br>
Internet and its Application
<br>
Data Mining<br>
Cryptography<br>
programming in c++ and data structure<br>
</body>
</html>
7
BCA.html
<html>
<body bgcolor="yellow">
BookList<br>
Open source software
<br>
Python programming<br>
Big data analytics<br>
programming in c++ and data structure<br>
</body>
</html>
BBA.html
<html>
<body bgcolor="cyan">
BookList<br>
Mathematical Foundations
<br>
Bussiness Administration<br>
Management concepts<br>
Business statics<br>
</body>
</html>
BIO.html
<html>
<body bgcolor="cyan">
BookList<br>
Organic chemistry
<br>
Physical chemistry<br>
Biological Dynamics<br>
</body>
</html>
8
OUTPUT:
HOMEPAGE
LOGIN
9
REGISTER
CATALOGUE
10
CART
BCA
11
RESULT:
Hence , the program for creating webpage with frame and table is executable and
result has been verified.
12
EX NO : 02 Create a Web Page Incorporating CSS
DATE: (Cascading Style Sheets)
AIM:
To write a program for Cascading style sheets.
ALGORITHM:
STEP1:Open notepad.
STEP2:Type the program for internal style sheet and save a file with
internal.html.
STEP3:Type the program for external style sheet and save a file with
external.html.
STEP4:Type the program for inline style sheet and save a file with in line.html.
STEP5:Type the program for css style and save a file with.css extension.
13
INLINEELEMENT:
<html>
<body style="background-color:lightcyan">
<p>In this example, the background color is set inline, in an internal stylesheet,
in an external style sheet
</p>
<p>Experimenting by removing styles to see how the cascading style sheets work
</p>
</body>
</html>
INTERNALSTYLESHEET:
<html>
<head>
<style>
body{background-color:green;}
#firstname{background-color:yellow;}
</style>
</head>
<body>
<divstyle="position:static; border-style: solid; color: red; top:100px; right:150px;">BSC
</div><br>
<divstyle="position:static;border-style:clashed;color:blue;">BCA</div>
14
<h1>Multiple Styles will cascade into one</h1>
<p>In this example, the background-color is set inline, in an internal style sheet,
and in an external style sheet.
</p>
<p id="first name"> Try experimenting by remaining styles to see how the
cascading style sheet work.
</p>
</body>
</html>
EXTERNALSTYLESHEET:
<html>
<head>
<styletype="text/css">
p.xx{color:red}
a.hover{color:green:}/*moreoverlink*/a
.active{color:yellow:}/*selectedlink*/
</style>
</head>
<body>
</a></b></p>
15
<p class="xxx">In this example, the background color is set inline in an internal
style sheet, and an external style sheet.</p>
<p>Try experimenting by remaining style to see how the cascading style sheet
work. </p>
</body>
</html>
Mystyle.css
body{
background-color:lightblue;
h1{
color: navy;
margin-left:20px;
16
OUTPUT:
INLINEELEMENT:
INTERNALSTYLESHEET:
17
EXTERNALSTYLESHEET:
18
RESULT:
Hence, The program for style sheet is created and the result has been verified.
19
EX NO: 03 SHELL PROGRAM TO FIND THE FACTORIAL OF AN
AIM:
To write a shell program for factorial of a number
ALGORITHM:
STEP1:Open the program
20
PROGRAM:
read n
if [ $n -gt 0 ]
then
i=1
f=1
while [ $i -le $n ]
do
f=`expr $f \* $i`
i=`expr $i + 1`
done
echo "Factorial of $n is $f"
else
echo "Enter a positive integer"
fi
21
OUTPUT:
Enter a number
4
Factorial of 4 is 24
Enter a number
-9
Enter a positive integer
22
RESULT:
Hence, A Shell program for factorial of a number is executed and Result has been
verified.
23
EX NO: 04 SHELL PROGRAM TO FIND THE DETAILS
AIM:
To Write a shell program to check whether the given string is palindrome or not
ALGORITHM:
STEP1:Open cygwin terminal
24
PROGRAM:
function line(){
echo "***************"
}
25
OUTPUT:
$ sh shell.sh
your username : user20
***************
current date and time : Wed Apr 26 11:40:16 IST 2023
***************
currently logged on users:
***************
26
RESULT:
Hence a Shell program is finding the details of user session is executed and the
result has been verified.
27
EX NO: 05 CREATE A SIMPE CALCULATOR IN JAVASCRIPT
DATE:
AIM:
To write a javascript program for creating simple calculator
ALGORITHM:
STEP1:Open notepad.
28
PROGRAM:
<html>
<head>
<title>JavaScript Calculator</title>
<style>
h1{
text-align:center;
padding:23px;
background-color:skyblue;
color:white;
}
#clear
{
width:270px;
border- radius:3px;
padding:20px;
background-color:red;
}
.formstyle
{
width:300px;
height:530px;
margin:auto;
border:3px solid skyblue;
border- radius:5px;
29
padding:20px;
}
input
{
width:20px;
background- color:green;
color:white;
border- radius:5px;
padding:2 6px;
margin:5px;
font-size:15px;
#calc
{
width:250px;
border-radius:3px;
padding:20px;
margin:auto;
</style>
</head>
<body>
<form name="form1">
<br><br>
<br><br>
<br><br>
<br>
</form>
</div>
</body>
</html>
32
OUTPUT:
33
RESULT:
Hence, the program has been executed and verified successfully.
34
EX NO: 06 JAVASCRIPT PROGRAM TO SCROLL THE NAME IN
AIM:
To write a Javascript program for developing a scrollbar.
ALGORITHM:
STEP1:Open notepad.
35
PROGRAM:
<html>
<head>
<style>
#para
{
width: 250px;
height: 150px;
overflow: scroll;
border:1px solid red;
font-size:25px;
}
</style>
</head>
<body>
<p id = "para" onscroll = "fun()"> Hi, Welcome to the IWASC. Our objective is to
provide quality education to rural children that empower the students to have a
sound career, competent to urban students and to inculcate cultured personality.
</p>
<script>
36
function fun()
{document.getElementById("para").style.color="red";
document.getElementById("para").style.background="lightgreen";
</script>
</body>
</html>
37
OUTPUT:
38
RESULT:
Hence, the program has been executed and verified successfully.
39
EX NO: 07 MESSAGE PASSING MECHANISM BETWEEN PAGES
DATE:
AIM:
To write a php program for message passing mechanism between pages.
ALGORITHM:
FORM.HTML
STEP1:Open notepad.
STEP 2:Type the program and save the program with .html in htdocs directory/
folder.
WELCOME.PHP:
STEP 3:Type the program and save the program with .php in htdocs folder.
STEP 4: Activate xamp control panel and start apache and my SQL server.
40
FORM.HTML:
<html>
<body><h1><center>MESSAGEPASSINGMECHANISMBETWEEN
PAGES</center></h1>
<br><br><br>Age:<inputtype="text" name="age"/>
<br><br><br>
<input type="submit"/><br><br><br>
</form>
</body>
</html>
WELCOME.PHP:
<html>
<body>
welcome
<?php
echo$_POST["fname"];?>!<br/>youare
<?php echo$_POST["age"];?>yearsold.
</body>
</html>
41
OUTPUT:
42
RESULT:
Hence, the program has been executed and verified successfully.
43
EX NO: 08 APPLICATION FOR EMAIL REGISTRATION
AIM:
To write a PHP program for application of email registration and login using PHP
and MYSQL.
ALGORITHM:
STEP1: Activate the xamp control panel and start Apache and mysql server.
STEP2: Click on mysql admin and click on create database menu then type name of the
database.
STEP4: Open notepad, type the program and save a file with filename.php in the htdocs
folder.
STEP5: Type all the program and save the file with filename.php in htdocs folder.
44
PROGRAM:
db.php
<?php
localhost then set empty.
$con = mysqli_connect("localhost","root","root","login");
if (mysqli_connect_errno()){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>
auth_session.php
<?php
session_start();
if(!isset($_SESSION["username"])) {
header("Location: login.php");
exit();
}
?>
Registration.php
<html>
<head>
<meta charset="utf-8"/>
<title>Registration</title>
</head>
<body>
<?php
require('db.php');
// When form submitted, insert values into the database.
if (isset($_REQUEST['username'])) {
$username = stripslashes($_REQUEST['username']);
$username = mysqli_real_escape_string($con, $username);
45
$email = stripslashes($_REQUEST['email']);
$email = mysqli_real_escape_string($con, $email);
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con, $password);
$create_datetime = date("Y-m-d H:i:s");
$query = "INSERT into `users` (username, password, email, create_datetime)
VALUES ('$username', '" . md5($password) . "', '$email',
'$create_datetime')";
$result = mysqli_query($con, $query);
if ($result) {
echo "<div class='form'>
<h3>You are registered successfully.</h3><br/>
<p class='link'>Click here to <a href='login.php'>Login</a></p>
</div>";
} else {
echo "<div class='form'>
<h3>Required fields are missing.</h3><br/>
<p class='link'>Click here to <a href='registration.php'>registration</a>
again.</p>
</div>";
}
} else {
?>
<form class="form" action="" method="post">
<h1 class="login-title">Registration</h1>
<input type="text" class="login-input" name="username" placeholder="Username"
required />
<input type="text" class="login-input" name="email" placeholder="Email
Adress">
<input type="password" class="login-input" name="password"
placeholder="Password">
<input type="submit" name="submit" value="Register" class="login-button">
<p class="link"><a href="login.php">Click to Login</a></p>
</form>
<?php
}
?>
</body>
</html>
46
Login.php
<html>
<head>
<meta charset="utf-8"/>
<title>Login</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<?php
require('db.php');
session_start();
if (isset($_POST['username'])) {
$username = stripslashes($_REQUEST['username']); // removes backslashes
$username = mysqli_real_escape_string($con, $username);
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con, $password);
$query = "SELECT * FROM `users` WHERE username='$username'
AND password='" . md5($password) . "'";
$result = mysqli_query($con, $query) or die(mysql_error());
$rows = mysqli_num_rows($result);
if ($rows == 1) {
$_SESSION['username'] = $username;
header("Location: dashboard.php");
} else {
echo "<div class='form'>
<h3>Incorrect Username/password.</h3><br/>
<p class='link'>Click here to <a href='login.php'>Login</a> again.</p>
</div>";
}
} else {
?>
<form class="form" method="post" name="login">
<h1 class="login-title">Login</h1>
<input type="text" class="login-input" name="username" placeholder="Username"
autofocus="true"/>
<input type="password" class="login-input" name="password"
placeholder="Password"/>
<input type="submit" value="Login" name="submit" class="login-button"/>
<p class="link"><a href="registration.php">New Registration</a></p>
</form>
47
<?php
}
?>
</body>
</html>
Logout.php
<?php
session_start();
if(session_destroy()) {
header("Location: login.php");
}
?>
Dashboard.php
<?php
include("auth_session.php");
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dashboard - Client area</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="form">
<p>Hey, <?php echo $_SESSION['username']; ?>!</p>
<p>You are now user dashboard page.</p>
<p><a href="logout.php">Logout</a></p>
</div>
</body>
</html>
48
OUTPUT:
49
RESULT:
Hence, the PHP program for application of email registration and login using
PHP and MYSQL and the result has been verified.
50
EX NO: 09 CREATE A FILE AND WRITE THE DATA INTO IT USING PHP
DATE:
AIM:
To write a PHP program to create a file and write the data into it using php.
ALGORITHM:
STEP1:Activate the xamp control panel and start Apache server.
STEP3:Open notepad, type the program and save a file with file. Php in the
htdocs folder.
51
PROGRAM:
FILE.PHP
<html>
<head>
<title>PHP file create and write example</title>
</head>
<body>
<form method="POST">
Enter String:<input type="text" name="name"><br/>
<br/>
<input type="submit" name="Submit" Value="Write File">
</form>
<?php
if(isset($_POST['Submit']))
{
$myfile=fopen("abc.txt","a");
$text=$_POST["name"];
fwrite($myfile,$text);
fclose($myfile);
}
?>
</body>
</html>
52
OUTPUT:
53
54
RESULT:
Hence, the program has been executed and verified successfully
55
EX NO: 10 PROGRAM TO PERFORM STRING OPERATIONS
AIM:
To write a program to perform string operations using perl.
ALGORITHM:
STEP1:Open parade perl ide.
56
PROGRAM:
#!/usr/bin/perl
use5.010;
use strict;
use warnings;
my$msg1="Welcome to OSS lab.";
my$msg2="This is a string operations using perl.";
print$msg1."".$msg2."\n";
print$msg1,"",$msg2,"\n";
print"$msg1$msg2\n";
#!/usr/bin/perl
use5.010;
my$user='Ana';
print 'Hello $user, welcome at our site.\n';
print"\n";
my $user='Ana';
my$day="today";
print "Hello $user, welcome at our site $day.\n";
57
OUTPUT:
58
RESULT:
59