You are on page 1of 53

TABLE OF CONTENTS

Page
Ex.No. Date Title Signature
no.

1 CREATE A WEB PAGE WITH FRAMES AND


TABLES
CREATE A WEB PAGE INCORPORATING CSS
2 (CASCADING STYLE SHEETS)

SHELL PROGRAM TO FIND THE FACTORIAL


3
OF AN INTEGER POSITIVE NUMBER

4 SHELL PROGRAM FOR CHECKING WHETHER


A GIVEN STRING IS PALINDROME OR NOT
5 CREATE A SIMPLE CALCULATOR IN
JAVASCRIPT
6 CREATE A JAVASCRIPT PROGRAM TO
SCROLL YOUR NAME IN THE SCROLL BAR
DEVELOP A PROGRAM AND CHECK
7 MESSAGE PASSING MECHANISM BETWEEN
PAGES
DEVELOP A PROGRAM AND CHECK FILE
8 SYSTEM FUNCTIONS,DATE & TIME
FUNCTIONS
CREATE A STUDENT DATABASE TABLE IN
9 MYSQL AND MANIPULATE
RECORDS(INSERT,DELETE,UPDATE)
RECORDS IN WEB BROWSER
10 DEVELOP A PROGRAM USING COOKIES AND
SESSION
EX.NO:1 CREATE A WEB PAGE WITH FRAMES AND TABLES
DATE:

AIM:

To create a web page with frames & tables

PROCEDURE:

STEP 1 : Start the process

STEP 2 : Create and store a web page for book store as bookstore.html

STEP 3: Create a program for right frame as right.html

STEP 4: Create login register, catalog creation and html pages independently

STEP 5: Create a program for left frames as left.html

STEP 6 : Create HTML document for Computer science , Commerce,


Mathematics, IT separately

STEP 7 : Stop the process


PROGRAM:

1.Book store.html
<html>
<frameset rows="18%,*">
<frame src="topframe.html" scrolling="no"/>
<frameset cols="15%,*">
<frame src="leftframe.html" noresize/>
<frame src="rightframe.html" name="rframe"/>
</frameset>
</frameset></html>
RightFrame.html
<html>
<head><title>Right Frame</title></head>
<body bgcolor="pink"><h1>Welcome to Online Book Shopping</h1>
</body></html>
Login.html
<html>
<head><title>Login</title></head>
<body bgcolor="pink">
<center><form>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>

LeftFrame.html
<html>
<head><title>Left Frame</title></head>
<body bgcolor=”#ffffcc”>
<center><h4><a href="cst.html" target="rframe">Computer Applications</a></h4>
<h4><a href="commerce.html" target="rframe">Commerce</a></h4>
<h4><a href="maths.html" target="rframe">Mathematics</a></h4>
<h4><a href="it.html" target="rframe">IT</a></h4></center>
</body></html>
Cart.html
<html>
<head><title>Cart Page</title></head>
<body><center><table width="100%">
<tr><th>Book Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Amount</th></tr>
<tr><td align="center">Java Programming</td>
<td align="center">Rs.150</td>
<td align="center">01</td>
<td align="center">Rs.150</td></tr>
<tr><td align="center">Internet and its Applications</td>
<td align="center">Rs.140</td>
<td align="center">02</td>
<td align="center">Rs.280</td></tr>
<tr><th>Total Amount</th>
<td align="center">Rs.430</td></tr>
</table></center>
</body></html>
Commerce.html
<html>
<head><title>Commerce</title></head>
<body bgcolor="cyan">
Book List<br>
Management Accounting<br>
Corporate Accounting<br>
Financial Accounting<br>
Industrial Organizations<br>
Principles of Marketing<br>
</body></html>

BCA.html
<html>
<head><title>Computer Applications</title></head>
<body bgcolor="cyan">
Book List<br>
Internet and its Applications<br>
Data Mining<br>
Cryptography<br>
Microprocessors and its Applications<br>
Programming in C++ and Data Structure<br>
Digital Logic and Microprocessor<br>
</body></html>
IT.html
<html>
<head><title>Information Technology</title></head>
<body bgcolor="cyan">
Book List<br>
Data Minig<br>
Network Security and Cryptography<br>
Mobile Computing<br>
Open Source Software<br>
</body></html>
Maths.html
<html>
<head><title>Mathematics</title></head>
<body bgcolor="cyan">
Book List<br>
Mathematical Foundations<br>
Business Statistics<br>
Operation Research<br>
Graph Theory<br>
Discrete Mathematics<br>
Mechanics<br></body></html>
Register.html
<html>
<head><title>Register New User!</title></head>
<body><form><center><h1><font size="3">Registration Form</font></h1>
<hr width="50%">
<pre>
User Name :<input type="text" maxlength=15 size=25/>
Password :<input type="password" maxlength=15 size=25/>
Confirm Password :<input type="password" maxlength=15 size=25/>
Gender : <input type="radio" name="a">Male</input><input type="radio"
name="a">Female</input>
Email-ID :<input type="text" maxlength=15 size=25/>
Address :<textarea rows=5 cols=30></textarea>
<input type="submit" value="Submit"/>
<input type="reset" value="Reset"/>
</pre></form>
</body></html>
TopFrame.html
<html>
<head><title>Top Frame</title></head>
<body bgcolor=#bbffbb>
<table border="1" width="100%">
<tr><th width="14%"><img src="shop.jpg" width=100 height=50/></th>
<th>Online Book Shopping</th></tr>
</table>
<table border="1" width="100%">
<tr><th><a href="rightframe.html" target="rframe">Home</a></th>
<th><a href="login.html" target="rframe">Login</a></th>
<th><a href="register.html" target="rframe">Register</a></th>
<th><a href="catalogue.html" target="rframe">Catalogue</a></th>
<th><a href="cart.html" target="rframe">Cart</a></th></tr>
</table></body></html>
OUTPUT:
Book Java Progr
Author P Rizwan Ahmed Rs 150
Moharam Pub£cation,Chennai.

Book Rtemet and its AppLc aeons


Author P.Rizwan Ahmed Rs 140
Moharam PubLcafion, Chennai
RESULT :

Thus the HTML program was successfully created and executed.


EX.NO:2 CREATE A WEB PAGE INCORPORATING CSS
(CASCADING STYLE SHEETS)
DATE:

AIM :

To create a web page with incorporating cascading style sheet

PROCEDURE :

STEP 1 : Start the process

STEP 2 : Create external style sheet in the name of xyz.css

STEP 3 : Create the html document as main text to display the content

STEP 4 : Access the external style sheet from document by using < link > stage
with in <head> section

STEP 5 : Use the ordered list to arrange web page content

STEP 6 : Use the internal style sheet to apply the CSS sheet of particular content

STEP 7 : Use the inline style sheet to apply the style of web page content

STEP 8 : Create a html table to display a result of the student

STEP 9 : Properly save the html file and run the document in any web browser

STEP 10 : Stop the process


PROGRAM:

<html>
<head>
<h1><center>ALL STYLE SHEETS</center></h1>
<title>USE of INTERNAL and EXTERNAL STYLESHEETS</title>
<link rel="stylesheet" href="xys.css" type="text/css">
<style type="text/css">
.vid
{
font-family:verdana;
font-style:italic;
color:red;
text-align:center;
}
.ani
{
font-family:tahoma;
font-style:italic;
font-size:20;
text-align:center;
}
font
{
font-family:georgia;
color:blue;
font-size:20;
}
ul
{
list-style-type:circle;
}
</style>
</head>
<body>
<ol style="list-style-type:lower-alpha">
<b>SRI LAKSHMI COLLEGE OF ARTS AND SCIENCE BANGARAM .</b>
<br><br><br>
<li>Department of Computer Applications
<li>Department of Computer Science
<li>Department of Information System Management
<li>PG Department of Information Technology
<li>PG & Research Department of Computer Science
</ol>
<p style="font-size:20pt;color:purple;text-align:center">SIRAJUDEEN, Asst.Professor &
Head</p>
<p class="ani">SRI LAKSHMI BANGARAM 606213<br>
Affiliated to Thiruvalluvar University,Vellore-632 115.<br>
</p>
<h2 class="vid">Self Management College </h2> <br>
<font>
<h2>List of Courses Offered </h2>
<ul>
<li>B.A English</li>
<li>BBA</li>
<li>BCA
<li>BCOM
<li>B.Sc., CS.</li>
<li>B.SC., Chemistry.</li>
<li>B.Sc., Maths.</li>
<li>B.Sc., Physics.</li>
</ul>
</font>
<h3>RESULT OF BCA STUDENTS</h3>
<table width="100%" cellspacing="2" cellpadding="2" border="5">
<tr>
<th>STU.NAME</th>
<th>MARKS</th>
<th>RESULTS</th>
</tr>
<tr>
<td align="center">Ramya</td>
<td align="center">100</td>
<td align="center">PASS</td>
</tr>
<tr>
<td align="center">Sarath</td>
<td align="center">99</td>
<td align="center">PASS</td>
</tr>
<tr>
<td align="center">Janani</td>
<td align="center">98</td>
<td align="center">PASS</td>
</tr>
</table>
</body>
</html>
OUTPUT:
RESULT :

Thus the HTML program was successfully created and executed.


EX.NO: 3 SHELL PROGRAM TO FIND THE FACTORIAL OF AN
INTEGER POSITIVE NUMBER

DATE:

AIM:

To create a shell program to find the factorial of an positive integer


number

PROCEDURE:

STEP 1 : Start the program

STEP 2: Open the editor to insert the text

STEP 3: As these are two models in Vi editor namely 1) common mode 2) insert
mode process Esc key for default mode insert mode and type text

STEP 4: To execute the code change into common mode

STEP 5: To insert the text process by using insert key

STEP 6: To save current file in command mode

STEP 7: Finally execute the shell script

STEP 8: Stop the process


PROGRAM:

echo"Enter a positive Number :"


read n
f=1
until [$n -lt 1]
do
f='expr $f \* $n'
n='expr $n - 1'
done
echo "Factorial is = $f"
OUTPUT:

Enter a positive Number


5

Factorial is = 120
RESULT :

Thus the Shell program using LINUX was successfully created and
executed.
EX.NO: 4 SHELL PROGRAM FOR CHECKING WHETHER A GIVEN
STRING IS PALINDROME OR NOT
DATE:

AIM:

To create a shell program for checking whether a given string is palindrome or


not

PROCEDURE:

STEP 1 : Start the process

STEP 2 : Open vi editor to insert the shell script

STEP 3 : Read the input from user and find the length of the string

STEP 4 : Check whether the given string is palindrome or not

STEP 5 : The string is palindrome display the given string is palindrome else the
given string is not palindrome

STEP 6 : Execute the shell program

STEP 7 : Stop the process


PROGRAM:

clear
echo "Enter a string"
read str1
str2=`rev<<<$str1`
if [$str1 = $str2 ]
then
echo "The string is palindrome"
else
echo "The string is not palindrome"
fi
OUTPUT:

Enter the string


Madam
The string is palindrome
Enter the string
The string is not palindrome
RESULT :

Thus the Shell program using LINUX was successfully created and
executed.
EX.NO: 5 CREATE A SIMPLE CALCULATOR IN JAVASCRIPT

DATE:

AIM :

To create a simple calculation using Javascript

PROCEDURE :

STEP 1 : Start the program

STEP 2 : Create html code using java

STEP 3 : specify the scripting language in <script > tag

STEP 4 : declare the java script variable define java script function for
calculation

STEP 5 : design the button for calculation and their numbers

STEP 6 : call the java script function to manipulate each button using click
function

STEP 7 : execute in the web browser

STEP 8 : stop the process


PROGRAM:

<html>
<head><title>Calculator</title>
<script language="javascript">
var inputstring=""
function updatestring(value)
{
inputstring=inputstring+value;
document.calculator.input.value=inputstring;
}</script></head>
<body bgcolor="black"><form name="calculator">
<table border=5 bordercolor=pink bgcolor="#ffffcc">
<tr><td><input type="text" name="input" maxlength=15 size=27><br/>
<input type="button" value="clear" onclick="input.value='';inputstring=''">
<input type="button" value="mod" onclick="updatestring('%')">
<input type="button" value="*" onclick="updatestring('*')"><br/>
<input type="button" value="7" onclick="updatestring('7')">
<input type="button" value="8" onclick="updatestring('8')">
<input type="button" value="9" onclick="updatestring('9')">
<input type="button" value="/" onclick="updatestring('/')"><br/>
<input type="button" value="4" onclick="updatestring('4')">
<input type="button" value="5" onclick="updatestring('5')">
<input type="button" value="6" onclick="updatestring('6')">
<input type="button" value="-" onclick="updatestring('-')"><br/>
<input type="button" value="1" onclick="updatestring('1')">
<input type="button" value="2" onclick="updatestring('2')">
<input type="button" value="3" onclick="updatestring('3')">
<input type="button" value="+" onclick="updatestring('+')"><br/>
<input type="button" value="0" onclick="updatestring('0')">
<input type="button" value="00" onclick="updatestring('00')">
<input type="button" value="." onclick="updatestring('.')">
<input type="button" value="=" onclick="input.value=eval(inputstring);">
</td>
</tr>
</body>
</html>
OUTPUT:
RESULT :

Thus the JAVASCRIPT program was successfully created and


executed.
EX.NO: 6 CREATE A JAVASCRIPT PROGRAM TO SCROLL YOUR
NAME IN THE SCROLL BAR
DATE:

AIM:

To wite a java script program to scroll your name in scroll bar

PROCEDURE:

STEP1: Start the program

STEP2: Write a html document

STEP3: Add the script into html code

STEP4: Create text area to display your name while scrolling the scroll bar

STEP5: Apply the CSS to scroll bar

STEP6: Save and execute the html document

STEP7: Stop the process


PROGRAM:

<html>
<head><title>Scroll Your Name</title>
<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:#000099");
document.write("}");
document.write("</style>");
</script>
</head>
<body>
<textarea id="textarea" roes="10" cols="30">
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
</textarea>
</body>
</html>
OUTPUT:

WELCOME TO SRI LAKSHMI COLLEGE


WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
WELCOME TO SRI LAKSHMI COLLEGE
RESULT :

Thus the JAVASCRIPT program was successfully created and


executed.
EX.NO: 7 DEVELOP A PROGRAM AND CHECK MESSAGE PASSING
MECHANISM BETWEEN PAGES
DATE:

AIM:

To develop a program and check message passing mechanism between page

PROCEDURE :

STEP1 : Start the process

STEP2 : Create a html document from page html

STEP3: Create a two text box as and get values from keyboard

STEP 4 : Create a php file called from page favourite ph

STEP 5: Pass message from html page to favourite php

STEP 6: Execute the document using any web browser

STEP7: stop the process


PROGRAM:

<html>
<head><title>Favorite!</title></head>
<?php
$YourName=$_REQUEST['YourName'];
$FavoriteWord=$_REQUEST['FavoriteWord'];
?>
<body bgcolor="#FFFFF" text="#000000">
<p>Hi
<?php
print $YourName;
?>
<p>You like the word <b>
<?php
print $FavoriteWord;
?>
!?! </b>
</body>
</html>
Form.html
<html>
<head><title>My Form</title></head>
<body>
<form action="favorite.php" method=post>
My Name is :<br>
<input type="text" name="YourName">
My Favorite Dirty Word is :<br/>
<input type="text" name="FavoriteWord">
<input type="submit" name="submit" value="That's Right!">
</form> </body> </html>
OUTPUT:
RESULT :

Thus the PHP program was successfully created and executed.


EX.NO: 8 DEVELOP A PROGRAM AND CHECK FILE SYSTEM
FUNCTIONS, DATE & TIME FUNCTIONS
DATE:

AIM:

To develop a program and check file system function date and time
function

PROCEDURE:

STEP1: Start the process

STEP2: Create document named get method html

STEP3: Create a PHP file named file system function and access in from html
document

STEP4: Execute the get method html using web browser

STEP5: Create a PHP file for date and time function

STEP6: Execute the PHP file on the web browser

STEP7: Stop the process


PROGRAM:

<?php
echo("<h3>Result with date():</h3><br/>");
echo("<br><br>".date("1")."</b><br/>");
echo("<br><b>".date("1 dS \of F Y h:i:s A"). "</b><br/>");
echo("<br><b>".date(1 dS F Y")."</b><br/>");
echo("<h3>Oct 3,1975 was on a ".date("1",mktime(0,0,0,10,3,1975))."</h3><br/>");
echo("<h3>Result With gmdate():</h3><br/>");
echo("<br><b>".gmdate("1")."</b><br/>");
echo("<br><b>".gmdate("1 dS \of F Y h:i:s A")."</b><br/>");
echo("<h3>Oct 3,1975 was on a</h3><b>".gmdate("1",mktime(0,0,0,10,3,1975))."</b><br/>");
echo("<br><b>TIME".yime()."</b><br/>");
?>
Getmethod.html
<html>
<head>
<title>Welcome to Sri Laskhmi College of Arts and Science</title>
</head>
<body>
UG Courses Offered :
B.A English
B.C.A
B.Sc., Maths
B.Sc., Physics
B.Sc., Chemistry
B.B.A
B.COM
B.Sc., CS
PG Courses Offered :
M.A English
M.Sc., CS
M.Sc., Maths
</body></html>

FileSysfun.php
<html>
<head>
<title>Open a File</title>
</head>
<body bgcolor="lavender">
<pre>
<?php
$filename="getmethod.html";
$fh=fopen("$filename","r");
while(!feof($fh))
{
$content=fgets($fh);
echo $content;
}
fclose($fh);
?>
</pre>
</body>
</html>
OUTPUT:

1.

2.
Result with date0:

1 17th of February 2017 08:10:30 LA'I

1 17th Februam 2017

Ot3l975wzsogal

ltesuit With gmdate{):

1
1 17th of February 2017 08:10:30 LA'I

Ot3l975wzsoga

1
T£!YfE1487319030
RESULT :

Thus the PHP program was successfully created and executed.


EX.NO: 9 CREATE A STUDENT DATABASE TABLE IN MYSQL AND
MANIPULATE RECORDS(INSERT,DELETE,UPDATE) RECORDS IN
WEB BROWSER
DATE:

AIM:

To create a student database table in my sql and manipulate records insert ,


delete, update in the web browser

PROCEDURE:

STEP1: Start the program

STEP2: Connect to MYSQL and select the updates

STEP3: Create table with html to display the student

STEP4: Write the PHP code for insert, delete and update student records

STEP5: Add or insert the student details, edit and delete web page

STEP6: Execute the student database application

STEP7: Stop the process


PROGRAM:

<?php>\$ n=mysql_conect(“lochalhost”,””);
Mysql_select_db(“test_db”,$cn);
?>

<html>
<head>
<tite>
Database sample application</tiltle>
</head>
<body>
<h1 align=”center”>Student database application</h1>
<hr size=”3” color=”#ff0000”/>
<?php
F(isset($_REQUEST[„sub‟])))//for insert
{
Mysql_query(“insert into student(s_id,s_name,s_age)
Values(NULL,””.$REQUEST[„txtxnmae‟].”,”.$_RESQUEST[„txtage‟].””)”);
Header(“location:index.php”);
}
If (iset($_RESUEST[„did‟]))/for delete
{
Mysql_query(“delete from student where bs_id=”‟.$_REQUEST[„did‟].””);
Header(“location:index.php”);
}
{
If (isset($_REQUEST[„eid]]))/for update
{
$query_fetch=mysql_query(“select * from stu7dent where s_id=”‟.$_REQUEST[„eid‟].””);
%rs_stud=mysql_fecth_object($query_fetch);
}
If (isset($REQUEST[„update‟]))
{
Mysql_query(“update student set
S_name=”‟.$REQUEST[„txtname‟].,s_age=”‟.$_REQUEST[„txtage‟]”
Where s_id=”.$_REQUEST[„txtid])or die(mysql_erroe());
Header(“location:index.php”);
}
?>

<from method="post">
<table align="center">
<tr>
<td>Name</td>
<td><input type="textr"name="txtname"
value="<?php echo $rs_stud->s_name;?>"/></td>
</tr>
<tr>
<td>Age</td>
<td><input type="text"name="txtag"value="<?php echo $rs_stud>s_age;?>"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit"name="sub"value="add"/><input
type="submit"name="update"/></td>
</tr><input type="hidden"name="txtid"value="<?php echo $rs_stud>s_id;?>"/><!--used to
update record-->
</table>
<table align="center">
<tr bgcolor="#cccccc">
<td>name</td>
<td>age</td>
<td></td>
<td></td>
</tr>
<?php
$query=mysql_query("select * from student");
while($rs=mysql_fetch_object($query))
{
?>
<tr>
<td>?php echo $rs->s_name;?></td>
<td>?php echo $rs->s_age;?></td>
<td>a href="index.php?eid=<?php echo $rs->s_id;?>'>edit</a></td>
<td>a href="index.php?did=<?php echo $rs-
>s_id;?>">Delete</a></rd>
</tr>
<?php
}
?>
</table>
</form>
</body>
</html>
OUTPUT:
RESULT :

Thus the PHP program was successfully created and executed.


EX.NO:10 DEVELOP A PROGRAM USING COOKIES AND SESSION

DATE:

AIM:

To develop a program using cookies and sessions

PROCEDURE:

STEP1: Start the program

Step2 : Create document as main html to design the form

STEP3: Create PHP file called cookies.php to start with sessions

STEP4: Execute main html on the web server

STEP5: Stop the program


PROGRAM:

<?php
session_start();
?>
<?php
$inTwoMoths=60*60*24*60+time();
setcookie('lastVisit',date("G:i-m/d/y"),$inTwoMonths);
if(isset($_COOKIE['lastVisit']))
{
$visit=$_COOKIE['lastVisit'];
echo "Your last visit was -".$visit;
}
else
echo "You've got some stale cookies!";
?>

<html>
<head><title>Sessions</title></head>
<body bgcolor="lavendor">
<font size=1 face="arial">
<h2>Tracking Visitors with Sessions</h2>
<?php
if(!isset($_SESSION))
{
$_SESSION[visitor_count]=0;
}
else
{
$_SESSION[visitor_count]++;
}
echo "You are visitor number ",$_SESSION['visitor_count'],".<br/>";
echo "The session id is : ",session_id();
?>
</font>
</body>
</html>
Main.html
<html>
<head>
<title>Cookies</title>
</head>
<body>
<form action="Cookies.php" method="post">
<p>
the last visited time was
<input type="submit" name="Display Now"/>
</p> </form> </body> </html>
OUTPUT:

Before refresh:

After refresh:
RESULT :

Thus the PHP program was successfully created and executed.

You might also like