PRIYA OSS RECORD
PRIYA OSS RECORD
ALGORITHM:
PROGRAM CODING:
<html>
<head>
<title>PROGRAM FOR FRAMES</title></head>
<frameset rows="30%,*">
<frame src="E:\OSS\ex1\ex1top.html">
<frameset cols="20%,*">
<frame src="E:\OSS\ex1\ex1left.html">
<frame src="E:\OSS\ex1\ex1right.html">
</frameset>
</frameset>
</html>
--------------------------------------------------------------------------------------------------------
File Name: ex1top.html
<html>
<body bgcolor="yellow">
<img src="E:\OSS\ex1\tuvlogo.bmp" align="LEFT">
<h1><center>THIRUVALLUR UNIVERSITY COLLEGE OF ARTS & SCIENCE
</center></h1>
<br><h2><center>Gajalnaickenpatti,Tirupattur
<br>Vellore District,Pincode:635 901.</center></h2>
</body>
</html>
---------------------------------------------------------------------------------------------------------
File Name: ex1left.html
<html>
<body bgcolor="pink">
<h2>UG COURSE DETAILS</h2>
<h3>
<ol type="1">
<li><a href="E:\OSS\ex1\cs.html">B.Sc. Computer Science</a>
<li><a href="E:\OSS\ex1\maths.html">B.Sc. Mathematics
<li><a href="E:\OSS\ex1\english.html">B.A. English</a>
<li><a href="E:\OSS\ex1\tamil.html">B.A. Tamil</a>
<li><a href="E:\OSS\ex1\bcom.html">B.Com.</a>
<li><a href="E:\OSS\ex1\bca.html">B.C.A.</a>
<li><a href="E:\OSS\ex1\bba.html">B.B.A.</a>
</ol></h3>
<h2>PG COURSE DETAILS</h2>
<ul type=fillround>
<li><a href="E:\OSS\ex1\ma.html">M.A. English</a>
<li><a href="E:\OSS\ex1\mcom.html">M.Com.</a>
</ul>
</body>
</html>
---------------------------------------------------------------------------------------------------------
<html>
<body bgcolor="green"><br><br>
<center> <table border=5 width=50%>
<caption align=top><b><h3>Students Strength Details</h3></b></caption>
</body>
</html>
---------------------------------------------------------------------------------------------------------
RESULT: Thus Frames and Tables have been created.
------------------------------------------------------------------------------------------------------------
OUTPUT
2. Create a web page incorporating CSS ( Cascading Style Sheets)
ALGORITHM:
PROGRAM CODING:
<html>
<head>
<link rel="stylesheet" type="text/css" href="E:\OSS\ex2\ex2.css">
</head>
<body>
<img src="E:\OSS\ex2\tuvlogo.bmp" width="160 height="160" align="left">
<h1>THIRUVALLUVAR UNIVERSITY COLLEGE OF ARTS & SCIENCE
</h1>
<h2>Gajalnaickenpatti , Tirupattur(via),<br>
Vellore, Pincode no:635 901. </h2> <br>
------------------------------------------------------------------------------------------------------
File Name: ex2.css
h1
{
font-size:30pt;
text-align:center;
color:red;
font-style:bold;
}
body
{
background-color:yellow;
}
h2
{
text-align:center;
font-style:italic;
color:green;
}
h3
{
text-align:center;
font-style:bold;
color:black;
font-size:20pt;
text-decoration:underline;
}
P
{
text-align:justify;
color:blue;
font-size:18pt;
}
h4,h5
{
font-style:bold;
font-size:18;
}
---------------------------------------------------------------------------------------------------------
RESULT: Thus created a web page, by incorporating cascading style sheet.
---------------------------------------------------------------------------------------------------------
OUTPUT
3. Write a shell program to find the factorial of an integer positive number
AIM: To write a shell program to find the factorial of an integer positive number.
ALGORITHM:
PROGRAM CODING:
--------------------------------------------------------------------------------------------------
OUTPUT
AIM: To Write a shell program for checking whether a given string is a palindrome or
not.
ALGORITHM:
Step 1: Start the Program.
Step 2: Read a string str to check whether it is palindrome or not.
Step 3: Find the length of the string and store it in len.
Step 4: Calculate len = len – 1.
Step 5: Set i = 1.
Step 6: Extract the desired column of value i from the string str using cut -c option
and store it in ch.
Step 7: Extract the desired column of value len from the string str using cut -c option
and store it in ch1.
Step 8: Check whether ch is not equal to ch1. If it is true then print the “Given input
string is not Palindrome”.
Step 9: Calculate len = len – 1.
Step 10: Calculate i = i +1.
Step 11: Otherwise Print the “Given input string is Palindrome”.
Step 12: Save and execute the file.
Step 13: Stop The Execution.
PROGRAM CODING:
ALGORITHM:
PROGRAM CODING:
<html>
<head> <title> CALCULATOR</title>
<center>
<h1> CALCULATOR </h1>
<script language="javascript">
var a=" "
function calc(value)
{
a+=value;
document.calculator.input.value=a;
}
</script> </head>
<body bgcolor=yellow>
<form name="calculator">
<table border=25 bordercolor=pink bgcolor=green cellpadding=12 cellspacing=10>
<tr><td>
<input type="text" name="input" fontsize=20 size=42>
<tr><td>
<input type="button" value=" CLEAR " onclick="input.value=' ';a=' ' ">
<input type="button" value=" MOD " onclick="calc('%')">
<input type="button" value=" * " onclick="calc('*')"> <br>
</tr></td> </table>
</form> </body>
</html>
OUTPUT
AIM: To Write a JavaScript program to scroll your name in the scroll bar.
ALGORITHM:
PROGRAM CODING
<html>
<head> <title>JAVA SCROLL TASK BAR</title>
<script language="javascript">
msg="WELCOME TO TUCAS-TIRUPATTUR";
spacer="............";
pos=0;
function scrollmessage()
{
window.status=msg.substring(pos,msg.length)+spacer+msg.substring(0,pos);
pos++;
if (pos>msg.length) pos=0;
window.setTimeout("scrollmessage()",300);
}
scrollmessage();
</script>
</head>
<body>
<p>THIRUVALLUVAR UNIVERSITY COLLEGE OF ARTS AND SCIENCE,
TIRUPATTUR</p>
<p>LOOK AT THE STATUS LINE AT THE BOTTOM OF THE PAGE</p>
</body>
</html>
OUTPUT
RESULT: Thus JavaScript program to scroll my name in the scroll bar has been
executed successfully.
AIM: To develop a program and check message passing mechanism between pages.
ALGORITHM:
<?php
// page1.php
session_start();
echo 'Welcome to page #1';
$_SESSION['Name'] = 'PRIYA ';
$_SESSION['Dept'] = 'DEPT OF CS ';
$_SESSION['time'] = time();
<?php
// page2.php
session_start();
echo 'Welcome to page #2<br />';
OUTPUT:
RESULT: Thus developed the program to check message passing mechanism between
pages.
8. Develop a program and check file system functions, date &time functions
AIM: To develop a program and check file system functions, date &time functions.
ALGORITHM:
PROGRAM CODING:
OUTPUT
RESULT:
Thus developed the program to check file system functions, date &time functions
9: Create a student database table in MYSQL and manipulate records (insert ,delete,
update) in a web browser
AIM: To create a student database table in MYSQL and manipulate records (insert ,delete,
update) in a web browser.
ALGORITHM:
PROGRAM CODING:
<?php
<html>
<head>
<title> Student </title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/styles.css">
<script>
function validateForm()
{
var x = document.forms["myForm"]["rollno"].value;
if(x==null || x=="")
{
alert("Roll No must be filled.");
return false;
}
var y = document.forms["myForm"]["name"].value;
if(y==null || y=="")
{
alert("Name must be filled.");
return false;
}
var z = document.forms["myForm"]["address"].value;
if(z==null || z=="")
{
alert("Address must be filled.");
return false;
}
var c = document.forms["myForm"]["contactno"].value;
if(c==null || c=="")
{
alert("Number must be filled.");
return false;
}
}
</script>
</head>
<body>
<?php
if (isset($_GET['msg']))
{
echo $_GET['msg'];
}
if(isset($_GET['msg1']))
{
echo $_GET['msg1'];
}
if(isset($_GET['msg2']))
{
echo $_GET['msg2'];
}
?>
<form name="myForm" action="create.php" onSubmit="return validateForm();"
method="post">
<table border="0" align="center" cellpadding="10" cellspacing="1" width="500">
<tr class="tableheader">
<td align="center" colspan="2">Student Registration</td>
</tr>
<tr class="tablerow" >
<td align="right">Roll No</td>
<td><input type="text" name="rollno" maxlength="5"></td>
</tr>
<tr class="tablerow">
<td align="right">Name</td>
<td><input type="text" name="name"></td>
</tr>
<tr class="tablerow">
<td align="right">Address</td>
<td><textarea name="address" required> </textarea></td>
</tr>
<tr class="tablerow">
<td align="right">Contact No</td>
<td><input type="text" name="contactno" maxlength="10"></td>
</tr>
<tr class="tableheader">
<td align="center" colspan="2"><input type="submit" name="submit"
value="Submit"></td>
</tr>
</table>
</form>
<form action="deletechk.php" method="post" onSubmit="return validate();">
<center>
<table height="200px" style="border:3px black solid;border-radius:5px" width="600px">
<th colspan="7" height="40pxs" style="border-bottom:3px black solid">List of Records
</th></th>
<?php
$q="select count(*) \"total\" from stud";
$ros=mysql_query($q,$conn);
$row=(mysql_fetch_array($ros));
$total=$row['total'];
echo "Total number of rows : ";
echo $total;
$q="select * from stud";
$ros=mysql_query($q,$conn);
$serial=1;
while($row=mysql_fetch_array($ros))
{
echo '<tr>';
echo '<td align="center" width="10px" style="border-bottom:1px #a1a1a1 solid">'.
$serial++ .'.';
echo '<td align="center" style="border-bottom:1px #a1a1a1 solid">'.$row['rollno'];
echo '<td align="center" style="border-bottom:1px #a1a1a1 solid">'.$row['name'];
echo '<td align="center" style="border-bottom:1px #a1a1a1 solid">'.$row['address'];
echo '<td align="center" style="border-bottom:1px #a1a1a1 solid">'.$row['contactno'];
echo "<td>" . "<a href='update.php?id=$row[id]'> Update </a>" . "</td>";
echo "<td>" . "<a href='' onClick='ConfirmDelete($row[id])'> Delete </a>" . "</td>";
echo '</tr>';
}
echo '</table>';
echo '<br/>';
?>
</table>
</center>
</form>
</body>
</html>
<?php
include 'include/connection.php';
$rollno = $_POST['rollno'];
$name = $_POST['name'];
$address = $_POST['address'];
$contactno = $_POST['contactno'];
if($_POST['submit']){
echo $query = "INSERT INTO stud (rollno,name,address,contactno)
VALUES('$rollno','$name','$address','$contactno')";
$exe = mysql_query($query);
header('Location: index.php?msg1=Details Added Successfully.');
}
?>
<?php
include 'include/connection.php';
$id = $_GET['id'];
$query = "SELECT * FROM stud WHERE id='$id'";
$result = mysql_query($query);
$person = mysql_fetch_object($result);
?>
<html>
<head>
<script>
function validateForm()
{
var x = document.forms["myForm"]["rollno"].value;
if(x==null || x=="")
{
alert("Roll No must be filled.");
return false;
}
var y = document.forms["myForm"]["name"].value;
if(y==null || y=="")
{
alert("Name must be filled.");
return false;
}
var z = document.forms["myForm"]["address"].value;
if(z==null || z=="")
{
alert("Address must be filled.");
return false;
}
var c = document.forms["myForm"]["contactno"].value;
if(c==null || c=="")
{
alert("Number must be filled.");
return false;
}
}
</script>
</head>
<body>
<center>
<h1> Student Registration </h1>
<form name ="myForm" action = "update1.php?id=<?php echo $id?>"
onSubmit="return validateForm()" method="post">
Roll No: <input type="text" name="rollno" maxlength="5" value="<?php echo
$person->rollno;?>"><br/><br>
Name: <input type="text" name="name" value="<?php echo
$person->name;?>"><br/><br>
Address: <textarea name="address" required><?php echo
$person->address;?></textarea><br/><br>
Contact No: <input type="text" name="contactno" maxlength="10" value="<?php echo
$person->contactno;?>"><br/><br>
<input type="submit" name="submit" value="Submit">
</form>
</center>
</body>
</html>
<?php
include 'include/connection.php';
$id = $_GET['id'];
$query = "DELETE FROM stud WHERE id = '$id'";
$exe = mysql_query($query);
header('Location: index.php?msg1=Record Deleted Successfully.');
?>
ALGORITHM:
PROGRAM CODING:
--------------------------------------------- main.html ------------------------------------------
<html>
<head> COOKIES </head>
<body>
<form action = "cookies.php" method ="post">
The last visited time was
<input type="submit" name="s" value = "click">
</form>
</body>
</html>
<?php
session_start();
?>
<html>
<head> SESSIONS </head>
<body bgcolor="cyan">
<font size="20" face=" broadway">
<h1> Tracking visitors with sessions </h1>
<?php
if (! isset($_SESSION))
{
$_SESSION[‘count’]=0;
}
else
{
$_SESSION[‘count’]++;
}
echo "You are visitor number :" ,$_SESSION['count'];
echo " <br> ";
echo "The session id is :", session_id();
?>
</font>
</body>
</html>
SESSION: (Each time the user refreshes this page, the count is incremented by 1 )
RESULT: Thus developed the program using cookies and session.