Osp Record
Osp Record
PRG.NO: 01
FRAMES AND TABLES
DATE: 22.12.2023
AIM
To create a simple web page using HTML tags with frames and tables.
PROCEDURE
DESCRIPTION
HTML
The language used to develop web page is called hyper text markup
language.
HTML tag begin within open angle bracket (<) and end with a close angle
bracket (>).
HEAD
The exception of information contained within the <title>..</title>tags
all information placed within the <head>...</head> tags are not displayed in the
browser.
BODY
The tags used to indicate the start and end of the main body of
textualinformation.
<BODY>…….</BODY>
BGCOLOR
Change of default background bgcolor to whatever color is specified this
tag.
<BODY BGCOLOR=”….”>
frames.hml
<html>
<head>
<title>SHANMUGA INDUSTRIES ARTS AND SCIENCE
COLLEGE</title>
<frameset rows="25%,75%" cols="*">
<frame src="top.html" />
<frameset cols="25%,75%">
<frame src="left.html" name="fr" />
<frame src="file2.html" name="right" />
</frameset>
</frameset></html>
top.html
<html>
<body>
<link rel="stylesheet" type="text/css" href="sample prgm1.html" />
<body bgcolor="#009900">
<h1><center>SHANMUGA INDUSTRIES ARTS AND SCIENCE
COLLEGE</center>
</h1>
<h2><marquee>ADMISSION OPENS</marquee></h2>
</body></html>
left.html
<html>
<body bgcolor="#FF00CC">
<a href="file1.html" target="right">UG DEGREE</a><br/>
<a href="file2.html" target="right">PG DEGREE</a><br/>
</body></html>
file1.html
<html>
<body>
<h4>UG DEGREE</h4>
<table border="1">
<tr>
<th>COURSE</th>
<th>AMOUNT</th>
</tr>
<tr>
<td>BCA</td>
<td>23000</td>
</tr>
<tr>
<td>B.B.A</td>
<td>9000</td>
</tr>
<tr>
<td>B.Com</td>
<td>9000</td>
</tr></table></body></html>
file2.html
<html>
<body>
<h4>PG COURSE</h4>
<table border="1">
<tr>
<th>COURSE</th>
<th>AMOUNT</th>
</tr>
<tr>
<td>M.Com</td>
<td>40000</td>
</tr>
<tr>
<td>M.A.English</td>
<td>20000</td>
</tr>
</tr></table></body></html>
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 02
CASCADING STYLE SHEET
DATE: 03.01.2024
AIM
To create a simple web page using HTML tags with cascading style sheet.
PROCEDURE
Step 5: In the <body> tag of the html document create an headers using
<h1>, <h2>, and <h3> ordered list using <ol> tag and tables.
Step 6: Run the program using an internet explorer web browser.
DESCRIPTION
HREF
Hyper Text Reference
This attribute prints the link to a book mark, another file either
withinthe same websites or elsewhere on the internet.
<a href=”URL”>
HEADING
<h1>….</h1>
<h2>….</h2>
<h3>….</h3>
h3{font-family:arial;font-size:20;color:cyan}
table{border-color:green}
td{font-size:20pt;color:megenta}
main.html
<html>
<head><h1><center>ALL STYLE SHEETS</center></h1><title>CSS</title>
<link rel="stylesheet" href="style.css" type="text/css">
<style type="text/css">
.vid{font-family:verdana;font-style:italic;color:brown;textalign:center;}
.ani{font-family:tohama;font-style:italic;font-size:20;textalign:center;}
font{font-family:georiga;color:blue;font-size:20}
ul{list-style-type:circle}
</style>
</head>
<body>
<ol style="list-style-type:lower-roman">
<b><center>SHANMUGA INDUSTRIES ARTS & SCIENCE
COLLEGE,</center><center>TIRUVANNAMALAI.</center><b>
<br><br><br>
<li>Department of Computer Application</li>
<li>Department of Computer science</li>
<li>Department of Mathematics</li>
<li>Department of Physics</li>
<li>Department of English</li>
</ol>
<p style="font-size:20pt;color:purple"></p>
<p class="ani">SHANMUGA INDUSTRIES ARTS & SCIENCE
COLLEGE,<br>MANALURPET ROAD,TIRUVANNAMALAI. <br> (Affilicated to
Thiruvalluvar University,Vellore)<br></p>
<h2 class="vid">Self Financing College</h2><br>
<font><h2>List of Courses Offered</h2>
<ul>
<li>B.A(English)</li>
<li>B.Com(General)</li>
<li>B.Sc(Mathametics)</li>
<li>B.Sc(Computer Science)</li>
<li>BCA</li>
<li>BBA</li>
<li>B.Com(Computer Application)</li>
<li>M.Sc(Mathametics)</li>
<li>M.A(English)</li>
</font>
<h3>RESULT OF BCA STUDENT</h3>
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 03
FACTORIAL OF AN INTEGER POSITIVE NUMBER
DATE: 11.01.2024
AIM
To write a shell program to find the factorial of an integer
Positive number.
PROCEDURE
CODING
clear
echo “Enter n value”
read n
f=1
while [ $n -gt 1 ]
do
f= $((f*n))
n= $((n-1))
done
echo “The factorial is $f”
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 04
DETAILS OF A USER SESSION
DATE: 24.01.2024
AIM
PROCEDURE
CODING
read input
case $input in
1)
who –count | greb user #syntax who <option><user optional>&grep used to filter
;;
2)
who –q | grep –v users #-q or –count option is to count the number of
users andprint the logged-in users.
;;
3)
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 05
SIMPLE CALCULATOR IN JAVASCRIPT
DATE: 29.01.2024
AIM
To create a simple calculator in Java Scrip using form and table.
PROCEDURE
DESCRIPTION
FORM
HTML forms can be made up of a variety of html elements that user input the
<form>. ..</form> tag.
TEXT
A text field (<input type="text"
BUTTON
A new element that provides a button other that a submit reset button.
<input type=button">
METHOD NAME
ONCLICK()
Files when an object is clicked on write equal().
EVAL()
The eval of function can be used to convert a string expression to a
numeric value.
TAGS
<html>
<head><title>calculator</title>
<script language="javascript">
varinputstring=" "
functionupdatestring(value)
{
inputstring+=value;
document.calculator.input.value=inputstring;
}
</script> </head>
<body bgcolor="green">
<form name="calc">
<table border=10 border color="black">
<tr><td>
<input type="text"name="input"size="18">
<br></td></tr>
<tr><td>
<input type="button" name="one" value="1" onclick="calc.input.value+='1'">
<input type="button" name="two" value="2" onclick="calc.input.value+='2'">
<input type="button" name="three" value="3" onclick="calc.input.value+='3'">
<input type="button" name="plus" value="+" onclick="calc.input.value+='+'"><br>
<input type="button" name="four" value="4" onclick="calc.input.value+='4'">
<input type="button" name="five" value="5" onclick="calc.input.value+='5'">
<input type="button" name="six" value="6" onclick="calc.input.value+='6'">
<input type="button" name="minus" value="-" onclick="calc.input.value+='-'"><br>
<input type="button" name="seven" value="7" onclick="calc.input.value+='7'">
<input type="button" name="eight"value="8" onclick="calc.input.value+='8'">
<input type="button" name="nine"value="9" onclick="calc.input.value+='9'">
<input type="button" name="mul" value="*" onclick="calc.input.value+='*'"><br>
<input type="button" name="clear" value="c" onclick="calc.input.value=''">
<input type="button" name="zero" value="0" onclick="calc.input.value+='0'">
<input type="button" name="equal" value="="
onclick="calc.input.value=eval(calc.input.value)">
<input type="button" name="div" value="/" onclick="calc.input.value+='/'"><br>
<input type="button" name="dot" value="." onclick="calc.input.value+='.'">
</td></tr></table>
</form>
</body>
</html>
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 06
SCROLL YOUR NAME USING JAVA SCRIPT
DATE: 03.02.2024
AIM
To create a program to scroll name using scroll box in Java Script
PROCEDURE
DESCRIPTION
<style sheet=”text/css”>
{
.
.
}
</style>
<script type=”text/javascript”>
</script>
TAGS
<html>
<head>
<script language="javascript">
document.write('<style type="text/css">');
document.write("#textarea{");
document.write("background-color: #009999;");
document.write("SCROLLBAR-HIGHLIGHT-COLOR: #000099; ");
document.write("SCROLLBAR-SHADOW-COLOR: #3366cc; ");
document.write("SCROLLBAR-ARROW-COLOR: #000099; ");
document.write("SCROLLBAR-TRACK-COLOR: #000099: ");
document.write("SCROLLBAR-DARKSHADOW-COLOR: #000099; ");
document.write("SCROLLBAR-BASE-COLOR: #6699ff; ");
document.write(" }");
document.write("</style>");
</script>
</head>
<body>
<textarea name="textarea" cols="30" rows="10" id="textarea">
Open Source Software
Open Source Software
Open Source Software
Open Source Software
Open Source Software
Open Source Software
Open Source Software
Open Source Software
Open Source Software
Open Source Software
Open Source Software
</textarea>
</body>
</html>
<html>
<head>
<STYLE TYPE="text/css"> BODY {
scrollbar-arrow-color:#F2B3OD; scrollbar-track-color:#FFFFCC; scrollbar-shadow-
color:#FFFFFF;
scrollbar- face-color:#FFFFCC;
scrollbar-darkshadow-color:#F2B3OD; scrollbar-3dlight-color:#F2B30D;
}
</STYLE>
</head>
</html>
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 07
CHECK MESSAGE PASSING SYSTEM
BETWEEN PAGES
DATE: 05.02.2024
AIM
PROCEDURE
prgm7.html
<html>
<body>
<form action="ex7.php"
method="post">Name: <br/>
<input type="text"
name="name"/><br/>Color:<br/>
<input type="text" name="Color"/>
<input type="Submit" name ="Submit" value="Submit"/>
</form>
</body>
</html>
ex7.php
<html>
<?php
$Yourname=$_REQUEST['Yourname'];
$Color=$_REQUEST['Color'];
?>
<body bgcolor="skyblue" text="golden">
<p> Hi
<?php
print $Yourname;
?>
<p>
You like the word<b>
<?php
print $Color;
?>
</b>
</body>
</html>
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 08
EMAIL REGISTRATION AND LOGIN
USING PHP AND MYSQL
DATE: 12.02.2024
AIM
To create a web application for E-Mail Registration and Login page using PHP and
MYSQL.
PROCEDURE
TAGS
register.php
<html>
<head>
<title> Register</title>
</head>
<body>
<center><h1> CREAT REGISTRATION AND LOGIN FORM USING PHP AND
MYSQL</h1></center>
<p> <a href="register.php">Register</a>|<a href="login.php"> Login</a></p>
<center><h2> Registration Form</h2></center>
<form action="" method="POST">
Username:<input type="text" name="user"><br/><br/>
Password:<input type="password" name="pass"><br/>
<input type="submit" value="Register"name="submit"/>
</form>
<?php
if(isset($_POST["submit"]))
{
if(!empty($_POST['user']) && !empty($_POST['pass']))
{
$user=$_POST['user'];
$pass=$_POST['pass'];
$con=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('log_details') or die("cannot select DB");
$query=mysql_query("SELECT * FROM login WHERE username='".$user."'");
$numrows=mysql_num_rows($query);
if($numrows==0)
{
$sql="insert into login(username,password)values('$user','$pass')";
$result=mysql_query($sql);
if($result)
{
echo "Account Successfully Created";
}
else
{
echo "Failure!";
}
}
else
{
echo "That username already exist! Please try again with another..";
}
}
else
{
echo "All Fields are required";
}
}
?>
</body>
</html>
login.php
<html>
<head>
<title> Login </title>
<body>
<center><h1> CREATE REGISTRATION AND LOGIN FORM USING PHP AND MYSQL
</h1> </center>
OPEN SOURCE SOFTWARE LAB [CPCA67] 25
DEPARTMENT OF COMPUTER APPLICATION, SIASC, TIRUVANNAMALAI.
<p><a href="register.php"> Register</a> | <a href="login.php"> Login</a></p>
<h3> Login Form</h3>
<form action=""method="POST">
Username:<input type="text" name="user"><br/><br/>
Password:<input type="password" name="pass"><hr/>
<input type="submit"value="Login"name="submit"/>
</form>
<?php
if(isset($_POST["submit"]))
{
if(!empty($_POST['user']) && !empty($_POST['pass']))
{
$user=$_POST['user'];
$pass=$_POST['pass'];
$con=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('log_details') or die("cannot select DB");
$query=mysql_query("SELECT * FROM login WHERE username='".$user."' AND
password='".$pass."'");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
if($user==$dbusername && $pass==$dbpassword)
{
session_start();
$_SESSION['sess_user']=$user;
header("Location:member.php");
}
}
else
{
echo "Invalid username or password!";
}
}
else
{
echo "All fields are required!";
}
}
?>
</body>
</html>
OPEN SOURCE SOFTWARE LAB [CPCA67] 26
DEPARTMENT OF COMPUTER APPLICATION, SIASC, TIRUVANNAMALAI.
member.php
<?php
session_start();
if(!isset($_SESSION["sess_user"]))
{
header("location:login.php");
}
else
{
?>
<html>
<head>
<title> Welcome</title>
</head>
<body>
<center><h1>CREATE REGISTRATION AND LOGIN FORM USING PHP AND
MYSQL</h1></center>
<h2> welcome, <?=$_SESSION['sess_user'];?>! <a href="logout.php">Logout</a></h2>
<p>
WE DO IT. SUCCESSFULLY CREATED REGISTRATION AND LOGIN FORM USING
PHP AND MYSQL..
</P>
</body>
</html>
<?php
}
?>
logout.php
<?php
session_start();
unset($_SESSION['sess_user']);
session_destroy();
header("location:login.php");
?>
OUTPUT
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 09
CREATE A FILE AND WRITE THE DATA
INTO IT USING PHP USING PHP
DATE: 13.02.2024
AIM
To create a file and write the data in to the file using PHP.
PROCEDURE
Step 1: This PHP script that allows a user to create and write to a file, as well
as read from the file
Step 2: It creates an HTML form with two submit buttons: "write File" and
"readFile".
Step 3: The form has a single text input field named "name" where the user
can enter a string.
Step 4: When the user clicks the "write File" button, the PHP script creates
a new file named "abc.txt" (if it doesn't already exist) and opens it for
writing with the "a" mode (appending to the end of the file).
Step 5: It then retrieves the text input from the form using the $_POST
superglobal variable and writes it to the file using the fwrite()
function.
Step 6: When the user clicks the "read File" button, the PHP script opens the
"abc.txt" file in read mode ("r"), retrieves the contents of the file using
thefgets() function, and prints it to the screen using the echo
statement.
Step 7: Finally, it closes the file handle using fclose().
TAGS
exp9.php
<html>
<head>
<title> PHP FILE CREATE AND WRITE THE DATA INTO IT USING PHP </title>
</head>
<body>
<form method= "POST">
<h3> Reading and Writing a file </h3>
Enter String: <input type="text" name="name"><br/><br/>
<input type="submit" name="Submit1" value="Write File">
<input type="submit" name="Submit2" value="Read File">
</form>
<?php
if(isset($_POST['Submit1']))
{
$myfile=fopen("abc.txt","a");
$text=$_POST["name"];
fwrite($myfile,$text);
fclose($myfile);
}
if(isset($_POST['Submit2']))
{
$myfile=fopen("abc.txt","r");
echo fgets($myfile);
fclose($myfile);
}
?>
</body>
</html>
OUTPUT
Write a file
Read a file
RESULT
Thus the program has been created and executed successfully.
PRG.NO: 10
PERFORM THE STRING OPERATION USING PERL
DATE: 17.02.2024
AIM
To create a program and perform the string operations using perl.
PROCEDURE
Sring.pl
#Concatenate
my $string1="Raman";
my $string2="Sita";
my $constr=$string1.$string2;
print"\n\nConcatenate String:$constr";
#Repetition
my $repstr="$string1"x 6;
print"\n\nRepentition:$repstr\n\n";
#length() function
print "\n\nlength of my string is:",length($str);
OUTPUT
RESULT
Thus the program has been created and executed successfully.