FSWD Manual
FSWD Manual
6 Write a Java Script that calculates the squares and cubes of the 25-26
numbers from 0 to 10 and outputs HTML text that displays the
resulting values in an HTML table format.
7 Write a Java Script code that displays text―TEXT-GROWING‖ 27-28
with increasing font size in the interval of 100ms in RED
COLOR, when the font size reaches 50pt it displays ―TEXT-
SHRINKING ‖ in BLUE color. Then the font size decreases to
5pt.
8 Write a simple Hello program using Angular JS library. 29-30
9 Write a program that the Angular JS application consists of 31-32
following three important parts:
1. ng-app
2. ng-model
3. ng-bind
10 Write a program by using filters to convert the following 33-43
1. uppercase
2. lowercase
3. currency
4. order By
5. filter
6. date
11 Example PHP program for contact-uspage. 44-45
12 Example PHP program for registering users of a web site and 46-50
login.
13 Install a database (My SQL or Oracle). 51-55
Create a table which should contain at least the following fields:
name, password, email-id, phone number (these should hold the
data from the registration form).
Write a PHP program to connect to that data base and extract data
from the tables and display them. Experiment with various SQL
queries.
Insert the details of the users who register with the website,
whenever a new user clicks the submit button in the registration
page.
14 Write a PHP which does the following job: Insert the details of 56-63
the 3 or 4 users who register with the web site by using
registration form. Authenticate the user when he submits the
login form using the user name and password from the database
(insteadof cookies)
1|Page
EXPERIMENT-1
Top frame: Logo and the college name and links to Homepage, Login page, Registration page,
Catalogue page and Cart page (the description of the see pages will be given below).
Left frame: At least four links for navigation, which will display the catalogue of respective links.
For e.g.: When you click the link “B.Tech” the catalogue for B.Tech Books should be displayed in
the Right frame.
Right frame: The pages to the links in the left frame must be loaded here. Initially this page contains
description of the website.
MCA
MBA
SOURCE CODE:
head.html
<html>
<head>
<title> Swarnandhra cet</title>
</head>
<body>
<fontface="ArialBlack"size="3">
<tableborder="1"cellspacing="0"cellpadding="0"width="100%">
<tr>
<tdalign="center"><imgsrc="logo.jpg"width="100"height="100"/></td>
<tdcolspan="4"style="color:blue;text-align:center;font-
size:15px">SwarnandhraCollegeofEngineeringandTechnology</td>
</tr>
<tr>
<tdalign="left"><ahref="description.html"target="des_page">HOME</a></td>
<tdalign="left"><ahref="login.html"target="des_page">LOGIN</a></td>
<tdalign="left"><ahref="registration.html"target="des_page">REGISTRATION</a></td>
<tdalign="left"><ahref="catalogue.html"target="des_page">CATALOGUE</a></td>
<tdalign="right"><ahref="cart.html"target="des_page">CART</a></td>
</tr>
</table>
</font>
</body></html>
2|Page
OUTPUT:
3|Page
dept.html
SOURCE CODE:
<html>
<head>
<title>DepartmentsPage</title>
</head>
<body>
<fontface="ArialBlack"size="4">
<tablealign="center"height="100%">
<tr>
<td><ahref="cat_btech.html"target="des_page">B.Tech</a></td>
</tr>
<tr>
<td><ahref="cat_mtech.html"target="des_page">M.Tech</a></td>
</tr>
<tr>
<td><ahref="cat_mca.html"target="des_page">MCA</a></td>
</tr>
<tr>
<td><ahref="cat_mba.html"target="des_page">MBA</a></td>
</tr>
</table>
</font>
</body>
</html>
4|Page
Output:
5|Page
description.html
SOURCE CODE:
<html>
<head>
<title>Descriptionpage</title>
</head>
<body>
<br><br><br><br><br><br><br><br><br><br>
<fontface="TIMESNEWROMAN"size="8">
<center>
DescriptionoftheWebsite
</center>
</font>
</body>
</html>
6|Page
Output:
7|Page
home.html
<html>
<head>
<title>Homepage</title>
</head>
<framesetrows="20,80">
<framesrc="head.html"name="head_page">
<framesetcols="15,85">
<framesrc="dept.html"name="dept_page">
<framesrc="desc.html"name="des_page">
</frameset>
</frameset>
</html>
8|Page
OUTPUT:
9|Page
EXPERIMENT-2
AIM:LoginPage:
Logo WebsiteName
Home Login Registration Catalogue Cart
B.Tech Username
M.Tech Login:
MCA Password:********
MBA
Submit Reset
SOURCE CODE:
login.html
<html>
<head>
<title>Login page</title>
</head>
<body>
<center>
<font face="Arial Black" size="4"><u><b>LOGIN FORM</b></u></font>
<br><br>
<form name="f1" action="" method="post">
<table frame="box" cellspacing="10">
<tr>
<td>Login</td>
<td><input type="text" size="25"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" size="25"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="SUBMIT">
10 | P a g e
OUTPUT
11 | P a g e
EXPERIMENT-3
AIM: Catalogue Page: The catalogue page should contain the details of all the books available in the website in a
table. The details should contain the following:
SOURCE CODE:
catalogue.html
<html>
<head>
<title> Catalogue Page</title>
</head>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td><img src="xmlb.gif" height="100" width="100"/></td>
<td>Book: XML Bible
<br>Author: Winston
<br>Publication: Wiely</td>
<td>$40.5</td>
<td><img src="adc.gif" height="100" width="100"/></td>
</tr>
<tr>
<td><img src="ai.gif" height="100" width="100"/></td>
<td>Book: AI
<br>Author: S.Russel
<br>Publication: Princeton hall</td>
<td>$63</td>
<td><img src="adc.gif" height="100" width="100"/></td>
12 | P a g e
</tr>
<tr>
<td><img src="java2.gif" height="100" width="100"/></td>
<td>Book: Java 2
<br>Author: Watston
<br>Publication: BPB publications</td>
<td>$35.5</td>
<td><img src="adc.gif" height="100" width="100"/></td>
</tr>
<tr>
<td><img src="html.gif" height="100" width="100"/></td>
<td>Book: HTML in 24 hours
<br>Author: Sam Peter
<br>Publication: Sam publications</td>
<td>$100</td>
<td><img src="adc.gif" height="100" width="100"/></td>
</tr>
</table>
</body>
</html>
13 | P a g e
OUTPUT:
14 | P a g e
mca.html
<html>
<head>
<title> MCA Catalogue Page</title>
</head>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td><img src="xmlb.gif" height="100" width="100"/></td>
<td>Book: XML Bible
<br>Author: Winston
<br>Publication: Wiely</td>
<td>$40.5</td>
<td><img src="adc.gif" height="100" width="100"/></td>
</tr>
<tr>
<td><img src="html.gif" height="100" width="100"/></td>
<td>Book: HTML in 24 hours
<br>Author: Sam Peter
<br>Publication: Sam publications</td>
<td>$100</td>
<td><img src="adc.gif" height="100" width="100"/></td>
</tr>
</table>
</body>
</html>
15 | P a g e
OUTPUT
16 | P a g e
bca.html
<html>
<head>
<title> BCA Catalogue Page</title>
</head>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td><img src="xmlb.gif" height="100" width="100"/></td>
<td>Book: XML Bible
<br>Author: Winston
<br>Publication: Wiely</td>
<td>$40.5</td>
<td><img src="adc.gif" height="100" width="100"/></td>
</tr>
<tr>
<td><img src="ai.gif" height="100" width="100"/></td>
<td>Book: AI
<br>Author: S.Russel
<br>Publication: Princeton hall</td>
<td>$63</td>
<td><img src="adc.gif" height="100" width="100"/></td>
</tr>
</table>
</body>
</html>
17 | P a g e
OUTPUT:
18 | P a g e
EXPERIMENT-4
AIM: RegistrationPage: Create a―registration form―withthe followingfields
1. Name(Textfield)
2. Password(passwordfield)
3. E-mailid(textfield)
4. Phonenumber(textfield)
5. Sex (radiobutton)
6. Dateofbirth (3select boxes)
7. Languagesknown(check boxes–English,Telugu, Hindi,Tamil)
8. Address(textarea)
SOURCE CODE:
<html>
<head>
<title>Registration Page</title>
</head>
<body>
<center>
<h3 align="center"><u>REGISTRATION PAGE</u></h3>
<table border="3">
<tr><td>
<form name="f1" action="" method="post" onsubmit="">
<table cellspacing="10" cellpadding="5">
<tr><td>NAME</td><td><input type="text" size="30" name="uname"/></td></tr>
<tr><td>PASSWORD</td><td><input type="password" size="30" name="pass"/></td></tr>
<tr><td>E-MAIL ID</td><td><input type="text" size="30" name="email"/></td></tr>
<tr><td> PHONE NUMBER</td><td><input type="text" size="15" name="phone"/></td></tr>
<tr><td>GENDER</td><td><input type="radio" name="gen" value="m" />MALE
<input type="radio" name="gen" value="f" />FEMALE </td></tr>
<tr><td>DATE OF BIRTH</td>
<input type="date" name="date" /></td></tr>
<tr><td>LANGUAGES KNOWN</td>
<td>
<input type="checkbox" value="eng" name="lang" />ENGLISH
<input type="checkbox" value="tel" name="lang" />TELUGU
<input type="checkbox" value="hin" name="lang" />HINDI
<input type="checkbox" value="tam" name="lang" />TAMIL
</td></tr>
<tr>
<td>ADDRESS</td>
<td><textarea name="addr" cols="25" rows="5"></textarea></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="SUBMIT"/>
<input type="reset" value="RESET" /></td>
</tr>
</table>
</form>
</td></tr></table>
</center>
</body>
</html>
19 | P a g e
OUTPUT:
20 | P a g e
EXPERIMENT-5
AIM: Design a web page using CSS (Cascading Style Sheets): Use different font, styles: In the style definition
you define how each select or should work (font, color etc.). Then, in the body of your pages, you refer to these
selectors to activate the styles.
SOURCE CODE:
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
<style>
body {
font-family: Arial, sans-serif;
color: #333;
line-height: 1.6;
}
h1 {
font-family: "Times New Roman", serif;
color: #ff6600;
font-size: 36px;
}
p{
font-style: italic;
}
.important {
font-weight: bold;
color: #0066cc;
}
#custom-font {
font-family: "Courier New", monospace;
}
</style>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>This is a paragraph with the default font.</p>
<p class="important">This is an important paragraph with bold and blue text.</p>
<p>This paragraph has italic text.</p>
<p id="custom-font">This paragraph uses a custom monospace font.</p>
</body>
</html>
21 | P a g e
OUTPUT:
22 | P a g e
EXPERIMENT-6
AIM: Write a Java Script that calculates the squares and cubes of the numbers from 0 to 10 and outputs
HTML text that displays the resulting values in an HTML table format.
SOURCE CODE:
<!DOCTYPE HTML>
<html>
<head> <style>
table, tr,
td
{
border: solid black;
width: 33%;
text-align: center;
border-collapse: collapse;
background-color:lightblue;
}
table { margin: auto;
} </style>
<script>
document.write( "<table><tr><thcolspan='3'> NUMBERS FROM 0 TO 10 WITH THEIR QUARES
AND CUBES </th></tr>" );
document.write( "<tr><td>Number</td><td>Square</td><td>Cube</td></tr>" );
for(var n=0; n<=10; n++)
{
document.write( "<tr><td>" + n + "</td><td>" + n*n + "</td><td>"+ n*n*n + "</td></tr>" ) ;
}
document.write( "</table>" ) ;
</script>
</head>
</html>
23 | P a g e
OUTPUT:
24 | P a g e
EXPERIMENT-7
AIM: Write a Java Script code that displays text― TEXT-GROWING ‖with increasing font size in the interval of
100ms in RED COLOR, when the font size reaches 50pt it displays ―TEXT- SHRINKING ‖in BLUE color. Then the
font size decreases to 5pt.
SOURCE CODE:
<html>
<head>
</head>
<body>
<center>
<pid="demo"/>
</center>
<script>
varvar1=setInterval(inTimer,1000);varsize=5;
varids=document.getElementById("demo");functioninT
imer(){
size+=5;
ids.innerHTML="TEXTGROWING";
ids.setAttribute("style","font-size:"+size+"px;color:red");if(size>=50)
{
clearInterval(var1);
varvar2=setInterval(deTimer,1000);
}
}
function deTimer(){size-=5;
ids.innerHTML="TEXTSHRINKING";
ids.setAttribute("style","font-size:"+size+"px;color:blue");if(size<=5)
{
clearInterval(var1);
}
}
</script>
</body>
</html>
25 | P a g e
OUTPUT:
26 | P a g e
EXPERIMENT-8
SOURCE CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
</head>
<body ng-app="myapp">
<div ng-controller="HELLO">
<h2>HELLO{{title}}!</h2>
</div>
<script>angular.module("myapp",[])
.controller("HELLO",function($scope){
$scope.title= "DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING";
});
</script>
</body>
</html>
27 | P a g e
OUTPUT:
28 | P a g e
EXPERIMENT-9
AIM: Write a program that the Angular JS application consists of following three important parts:
1. ng-app
2. ng-model
3. ng-bind
SOURCE CODE:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div ng-app="">
<p ng-bind="name"></p>
</div>
</body>
</html>
29 | P a g e
OUTPUT:
30 | P a g e
EXPERIMENT-10
SOURCE CODE:
Upper.html:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
</div>
<script>
$scope.firstName = "RAVI",
$scope.lastName = "teja"
});
</script>
</body>
</html>
31 | P a g e
OUTPUT:
32 | P a g e
lower.html:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
</div>
<script>
$scope.firstName = "ravi",
$scope.lastName = "TEJA"
});
</script>
</body>
</html>
33 | P a g e
OUTPUT:
34 | P a g e
currency.html:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
</div>
<script>
app.controller('costCtrl', function($scope) {
$scope.price = 59;
});
</script>
</body>
</html>
35 | P a g e
OUTPUT:
36 | P a g e
orderby.html:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<ul>
</ul>
</div>
<script>
app.controller('orderCtrl', function($scope) {
});
</script>
</body>
</html>
37 | P a g e
OUTPUT:
38 | P a g e
filter.html:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<ul>
{{ x }}
</li>
</ul>
</div>
<script>
$scope.names = [
'raviteja','rahul','praneeth','sanjay','syham','neeraja','chandhrika','jhanavi','prasad','ankammarao'
];
});
</script>
<p>This example displays only the names containing the letter "i".</p>
</body>
</html>
39 | P a g e
OUTPUT:
40 | P a g e
date.html:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
</div>
<script>
app.controller('datCtrl', function($scope) {
});
</script>
</body>
</html>
41 | P a g e
OUTPUT:
42 | P a g e
EXPERIMENT-11
43 | P a g e
OUTPUT:
44 | P a g e
EXPERIMENT-12
SOURCE CODE:
register.php
<!DOCTYPE html>
<html>
<head>
<title>Registration</title>
</head>
<body>
<h2>Register</h2>
<form method="post">
<label for="email">Email:</label>
<label for="username">Username:</label>
<label for="password">Password:</label>
</form>
</body>
</html>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
45 | P a g e
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$username = $_POST['username'];
$phone_number = $_POST['phone_number'];
$sql = "INSERT INTO users (first_name, last_name, email, username, password, phone_number)
} else {
$connection->close();
?>
46 | P a g e
Login.php:
SOURCE CODE:
<!DOCTYPE html>
<html>
<head>
<title>Login</title></head>
<body>
<h2>Login</h2>
<form method="post">
<label for="username">Username:</label>
<label for="password">Password:</label>
</form></body>
</html>
<?php
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
$result = $connection->query($sql);
if ($result->num_rows == 1) {
$_SESSION['username'] = $username;
} else {
?>
47 | P a g e
OUTPUT:
48 | P a g e
EXPERIMENT-13
1. Create a table which should contain at least the following fields: name, password, email-id, phone
number (these should hold the data from the registration form).
2. Write a PHP program to connect to that data base and extract data from the tables and display them.
Experiment with various SQL queries.
3. Insert the details of the users who register with the website, whenever a new user clicks the submit
button in the registration page.
SOURCE CODE:
Register.php
<!DOCTYPE html>
<html>
<head>
<title>User Registration</title>
</head>
<body>
<h2>User Registration</h2>
<label for="name">Name:</label>
<label for="password">Password:</label>
<label for="email">Email:</label>
</form>
</body>
</html>
49 | P a g e
Registration_process.php:
<?php
if ($conn->connect_error) {
$name = $_POST['name'];
$password = $_POST['password'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$sql_insert = "INSERT INTO users (name, password, email, phone_number) VALUES (?, ?, ?, ?)";
$stmt = $conn->prepare($sql_insert);
if ($stmt->execute()) {
} else {
$stmt->close();
} else {
$conn->close();
?>
50 | P a g e
Display.php:
<!DOCTYPE html>
<html>
<head>
<title>User Data</title>
</head>
<body>
<h2>User Data</h2>
<?php
if ($conn->connect_error) {
$result_all = $conn->query($sql_select_all);
if ($result_all->num_rows > 0) {
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone Number</th>
</tr>";
echo "<tr>";
51 | P a g e
echo "<td>" . $row["phone_number"] . "</td>";
echo "</tr>";
echo "</table>";
} else {
$conn->close();
?>
</body>
</html>
52 | P a g e
OUTPUT:
53 | P a g e
EXPERIMENT-14
AIM: Write a PHP which does the following job: Insert the details of the 3 or 4 users who register with the web site
by using registration form. Authenticate the user when he submits the login form using the user name and password
from the database (instead of cookies)
SOURCE CODE:
register.php
<!DOCTYPE html>
<html>
<head>
<title>Registration</title>
</head>
<body>
<h1>Register</h1>
<label for="username">Username:</label>
<label for="password">Password:</label>
<label for="email">Email:</label>
</form>
</body>
</html>
54 | P a g e
Register_process.php
<?php
$host = 'localhost';
$dbname = 'mydb';
$username = 'root';
$password = '';
try {
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// User input
$username = $_POST['username'];
$email = $_POST['email'];
$query = "INSERT INTO users (username, password, email) VALUES (:username, :password, :email)";
$stmt = $db->prepare($query);
// Registration successful
} else {
} else {
echo "Invalid form data. Please make sure all fields are filled.";
?>
55 | P a g e
Registration_success.php:
<!DOCTYPE html>
<html>
<head>
<title>Registration Successful</title>
</head>
<body>
<h1>Registration Successful</h1>
<p>You have successfully registered. You can now <a href="login.php">log in</a>.</p>
</body>
</html>
56 | P a g e
login.php:
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Login</h1>
<label for="username">Username:</label>
<label for="password">Password:</label>
</form>
</body>
</html>
57 | P a g e
Login_process.php
<?php
$host = 'localhost';
$dbname = 'mydb';
$username = 'root';
$password = '';
try {
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT id, username, password FROM users WHERE username = :username";
$stmt = $db->prepare($query);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
session_start();
$_SESSION['user_id'] = $user['id'];
$_SESSION['username'] = $user['username'];
} else {
} else {
echo "Invalid form data. Please make sure all fields are filled.";
?>
58 | P a g e
Login_success.php
<!DOCTYPE html>
<html>
<head>
<title>Login Successful</title>
</head>
<body>
<h1>Login Successful</h1>
</body>
</html>
59 | P a g e
OUTPUT:
60 | P a g e