Full Stack Prog Lab Manual
Full Stack Prog Lab Manual
TECHNOLOGY
(An Autonomous Institution)
(Approved by AICTE – New Delhi, Affiliated to Anna University - Chennai)
Pachapalayam, Perur Chettipalayam, Coimbatore
LAB MANUAL
VI – SEMESTER
—Ms. V. Preetha
Assistant Professor
Department of Computer
Science and Engineering
FULL STACK PROGRAMMING LABO L T P C
20CS015
RATORY 0 0 4 2
This course will enable the students to learn Front end and back end programming and to develop dynamic and
interactive websites / web applications using internet technologies
LIST OF EXPERIMENTS:
1. Creation of static and functional websites using HTML5 and CSS3 that could pass W3C validation. Include
maps and images.
2. Creation of webpage / website that employs advanced aesthetic effects supported by CSS3.
3. Creation of Interactive web page / website using JavaScript and employing DOM manipulation and Event
Handling features of JavaScript
4. Creation of dynamic website like Online result portal using Java Servlet as server-side scripting language.
Implementation should also include database access.
5. Creation of dynamic webpage that provides count of number of unique visitors to the website. Use the
concept of cookies and use Java Servlet as server-side scripting language.
6. Creation of dynamic web page that provides user session management. Use PHP as server-side scripting
language.
7. Create a single page web application using AJAX.
COURSE OUTCOMES:
CO1: Ability to learn the structure of web application development. CO1: Ability to implement a static
website with latest W3C standards
CO2: Ability to implement an interactive website with client-side programming
CO3: Ability to implement a dynamic web page / web application with database access and session management.
REFERENCES:
1. Deitel and Deitel and Nieto, “Internet and World Wide Web - How to Program”, Prentice Hall, 5th Edition,
2012.
2. Jeffrey C. Jackson, Web Technologies A Computer Science Perspective, 1st edition, Pearson Education,
2011.
3. Chris Bates, Web Programming: Building Internet Applications, 3rd Edition, Wiley India Pvt. Limited,
2007.
4. Robert W. Sebesta, Programming the World Wide Web, 7th Edition, Pearson, 2013.
5. Eric Freeman, Elisabeth Robson, Head First HTML5 Programming, Building Web Apps with JavaScript,
1st Edition, O'Reilly Media, Incorporated, 2011.
6. Jason Hunter, William Crawford, Java Servlet Programming, 2nd Edition, O'Reilly Media, 2010.
1. Creation of static webpage
<!DOCTYPE html>
<html>
<head>
<meta charset=”UTF-8”>
</head>
<body>
<hr>
<h2>January 2023</h2>
<hr>
<h3>Calender</h3>
<table>
<thead>
<caption>Monthly calender</caption>
<tr>
</tr>
</thead>
<tbody>
<tr>
<td>Sunday</td>
<td>Monday</td>
<td>Tuesday</td>
<td>Wednesday</td>
<td>Thursday</td>
<td>Friday</td>
<td>Saturday</td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</tbody>
</table>
<h3>Activity logs</h3>
<ul>
</ul>
<ol>
</ol>
<h3>References</h3>
<ol>
</ol>
<h3>My Instituition</h3>
<p>SRIT is one among the most eminent Educational Institutions in Coimbatore district. SRIT is
recognized as one of the leaders in Engineering Education, Research and Application of knowledge for
the betterment of the society and the country. The college has imprinted a position in the Engineering
Education by creating graduates to the industry and the society. Since its inception in the year 2002, the
institution has been continuously motivated to make a permanent mark in the education field by
creating technocrats, sound in Academics and Value system.</p>
</body>
</html>
2. Cascading style sheet
<!DOCTYPE html>
<html>
<head>
<style>
Table, th, td {
</style>
</head>
<style>
H1 {color:red;}
H2 {color:blue;}
</style>
<body>
<hr style=”height:2px;border-width:0;color:gray;background-color:gray”>
<hr style=”height:2px;border-width:0;color:pink;background-color:gray”>
<ul>
<li>C</li>
<li>C++</li>
<li>JAVA</li>
</ul>
<hr style=”height:2px;border-width:0;color:gray;background-color:gray”>
<ol>
<li>Drawing</li>
<li>Gardening</li>
<li>Helping others</li>
</ol>
<hr style=”height:2px;border-width:0;color:gray;background-color:gray”>
<table>
<tr>
<th>QUALIFICATION</th>
<th>PERCENTAGE</th>
</tr>
<tr>
<td>CSE(cgpa)</td>
<td>8.4%</td>
</tr>
<tr>
<td>12TH</td>
<td>74.5%</td>
</tr>
<tr>
<td>10th</td>
<td>91.8%</td>
</tr>
</table>
<hr style=”height:2px;border-width:0;color:gray;background-color:gray”>
<p><i>[email protected] </i></p>
<hr style=”height:2px;border-width:0;color:gray;background-color:gray”>
</body>
</html>
Style.css
Body
Background-color: #ffca33;
Img{ Width:2
00px;
Height:200px;
Align=”right”;
Image_map.html:
<html>
<head>
<title>IMAGE MAP</title>
</head>
<body>
Shape=’circle’
Coords=’175,495,30’
Title=’Tamilnadu’/>
Shape = “rect”
Coords = “100,400,150,450”
Shape = “poly”
Shape = “poly”
Coords = “108,455,150,515,115,490,148,495,110,448,155,501”
</map></body></html>
Tamilnadu.html:
<html>
<head>
</head>
<body>
<center>
<h1>TAMIL NADU</h1>
</center>
<hr>
<ul>
<li>Language : Tamil</li>
<li>Population : 6,21,10,839</li>
</ul>
<hr>
</body>
</html>
Karnataka.html:
<html>
<head>
<title>ABOUT KARNATAKA</title>
</head>
<body>
<center>
<h1>KARNATAKA</h1>
</center>
<hr>
<ul>
<li>Capital : Bangalore</li>
<li>Language : Kannada</li>
<li>Population : 5,27,33,958</li>
</ul>
<hr>
<html>
<head>
<title>ABOUT ANDHRAPRADESH</title>
</head>
<body>
<center>
<h1>ANDHRA PRADESH</h1>
</center>
<hr>
<ul>
<li>Capital : Hyderabad</li>
<li>Language : Telugu</li>
<li>Population : 7,57,27,541</li>
</ul>
<hr>
<html>
<head>
<script type=”text/javascript”>
Function validate()
If(email==””){
}else{
Var re = /^(?:[a-z0-9!#$%&’*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&’*+/=?^_`{|}~-]+)*|”(?:[\x01-
\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*”)@(?:(?:[a-z0-9](?:[a-
z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-
9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-
\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/;
Var x=re.test(email);
If(x){
}else{
Return false;
If(mobile==””){
Return false;
}else{ If(isNaN(m
obile)){
Return false;
</script>
</head>
<body>
<center>
<h1>Java Script Form validation Test</h1>
<h3>Sign Up Form</h3>
</form>
</center>
</body>
</html>
5. Create a Web page that displays the marks scored by students in semester exam using
HTML table. Use JavaScript to perform the following
a. Read the marks.
b. Calculate the total marks and Print the total along with average mark.
c. Print the result Pass / Fail in the next column.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Experiment-5</title>
</head>
<body>
<table>
<center>
<caption><b>Mark Statement</b></caption>
<tr>
<th>Name</th>
<th>Tamil</th>
<th>English</th>
<th>Maths</th>
<th>Science</th>
<th>Social Science</th>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
<br>
<table id=”TableScore”>
<caption><b>Student Data</b></caption>
<tr>
<th>Name</th>
<th>Total</th>
<th>Average</th>
<th>Result</th>
</tr>
</table>
</center>
<script type=”text/Javascript”>
Function Sub() {
Var n,k,r,e,v,z,sum,avg;
N=document.getElementById(‘aname’).value;
K=parseInt(document.getElementById(‘ta’).value);
R=parseInt(document.getElementById(‘E’).value);
E=parseInt(document.getElementById(‘M’).value);
V=parseInt(document.getElementById(‘S’).value);
Z=parseInt(document.getElementById(‘SS’).value);
Sum=k+r+e+v+z;
Avg=sum/5;
Var newTable=document.getElementById(“TableScore”);
Var row=newTable.insertRow();
Var cell1=row.insertCell(0);
Var cell2=row.insertCell(1);
Var cell3=row.insertCell(2);
Var cell4=row.insertCell(3);
Cell1.innerHTML=n;
Cell2.innerHTML=sum;
Cell3.innerHTML=avg;
If(avg>=70)
Cell4.innerHTML=”Pass”;
Else
Cell4.innerHTML=”Fail”;
}
}
</script>
</body>
</html>
6. Design a webpage for a college and change the webpage content using DOM manipulation
and Event Handling features of JavaScript.
<!DOCTYPE html>
<html>
<head>
</head>
<body onload=”myFunction1()”>
<center>
<p id=”wel”>WELCOME</p>
</center>
<p1> SRIT is one among the most eminent Educational Institutions in Coimbatore district. SRIT is
recognized as one of the leaders in engineering education, research and application of knowledge to the
betterment of the society and the country. The college has imprinted a position in the engineering
education by delivering graduates to the industry and the society. </p1>
<br>
<center>
<tr>
<th>DEPARTMENT NAME</th>
</tr>
<tr>
<td><button onclick=”cse()”>CSE</button></td>
<td id=”val”>250</td>
</tr>
<tr>
<td><button onclick=”mech()”>MECH</button></td>
<td id=”val2”>120</td>
</tr>
<tr>
<td><button onclick=”it()”>IT</button></td>
<td id=”val3”>180</td>
</tr>
</table>
</center>
<p id=”ce”></p>
<p id=”me”></p>
<p id=”itt”></p>
<script>
Document.addEventListener(“click”, myFunction);
Function myFunction() {
Document.getElementById(“wel”).style.color = “red”;
Document.getElementById(“wel”).style.fontSize = “largest”;
Function myFunction() {
Function cse() {
Document.getElementById(“ce”).innerHTML = “<P> COMPUTER SCIENCE DEPARTMENT :</P> The four
year under graduate programme in Computer Science Department is intended to train the students in
both advanced areas in the core courses and specialized topics in the emerging technology.";
Document.getElementById(“val”).innerHTML = “300”;
Function mech() {
Document.getElementById(“val2”).innerHTML = “150”;
Function it() {
Document.getElementById(“val3”).innerHTML = “89”;
Document.getElementById(“ce”).addEventListener(“mouseover”,mouseOver);
Document.getElementById(“ce”).addEventListener(“mouseout”,mouseOut);
Function mouseOver(){
Document.getElementById(“ce”).style.color = “red”;
Function mouseOut(){
Document.getElementById(“ce”).style.color = “blue”;
Document.getElementById(“me”).addEventListener(“mouseover”,mouseOVer);
Document.getElementById(“me”).addEventListener(“mouseout”,mouseOUt);
Function mouseOVer(){
Document.getElementById(“me”).style.color = “yellow”;
}
Function mouseOUt(){
Document.getElementById(“me”).style.color = “green”;
Document.getElementById(“itt”).addEventListener(“mouseover”,mouseOVEr);
Document.getElementById(“itt”).addEventListener(“mouseout”,mouseOUT);
Function mouseOVEr(){
Document.getElementById(“itt”).style.color = “pink”;
Function mouseOUT(){
Document.getElementById(“itt”).style.color = “black”;
Function myFunction1() {
Alert(“Page is loaded”);
</script>
</body>
</html>
7. Create dynamic website like Online result portal using PHP as server-side scripting
language. Implementation should also include database access.
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<label for="regno">RegNo:</label><br>
</form>
</body>
</html>
Store.php
<?php
if($conn->connect_error){
echo $conn->connect_error;
else{
$result = $conn->query($stmt);
echo"<table border='1'><tr><th>RegNo</th><th>Name</th><th>Grade</th></tr>";
while($row = $result->fetch_assoc()){
echo "<tr><td>".$row["rollno"]."</td>";
echo "<td>".$row["name"]."</td>";
echo "<td>".$row["grade"]."</td></tr>";
echo "<table>";
?>
2. Create table result with 3 columns rollno, name, grade and add 3 rows with roll numbers 1, 2, 3
8. Create a dynamic webpage that provides count of number of unique visitors to the
Import java.io.*;
Import javax.servlet.*;
Import javax.servlet.http.*;
hitCount = 0;
HttpServletResponse response)
Response.setContentType(“text/html”);
// increment hitCount
hitCount++;
String docType
+ “transitional//en\”>\n”;
Out.println(
docType + “<html>\n”
+ “</h2>\n”
+ “</body>”
+ “</html>”);
OR
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<%
Integer i = (Integer)session.getAttribute("count");
if(i==null || i==0){
i=1;
else{
i++;
}
session.setAttribute("count", i);
%>
</body>
</html>
9. Create a dynamic web page that provide user session management. Use PHP as server-side
scripting language.
a. Create Database with following attributes: id, username, password and role.
b. Create credentials for admin, faculty and student.
c. Display the session for each user.
Table Creation
1. Create database name testing_one
2. Create table name login with four columns id`, `username`, `password`, `role’
Login.php
<?php
Session_start();
If($con == TRUE)
//echo “connected”;
If(isset($_POST[‘username’]))
If($sql->num_rows == 1)
{
While($row = $sql->fetch_assoc())
Else
?>
<html>
<body>
</form>
</body>
</html>
Admin.php
<?php
Session_start();
$con = new MySQLi(“localhost”, “root”, “”, “testing_one”);
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1> Hi, Welcome to admin Page </h1>
<h2><?php echo $_SESSION[‘username’];?></h2>
<a href=”logout.php”> Logout </a>
</body>
</html>
Faculty.php
<?php
$con = new MySQLi(“localhost”, “root”, “”, “testing_one”);
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1> Hi, Welcome to Faculty Page </h1>
Student.php
<?php
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1> Hi, Welcome to Student Page </h1>
<?php
Session_start();
If($_SESSION[‘role’] == ‘admin’)
{
Header(“Location:admin.php”);
}
If ($_SESSION[‘role’] == ‘faculty’) {
Header(“Location:faculty.php”);
}
If ($_SESSION[‘role’] == ‘student’){
Header(“Location:student.php”);
?>
10. Implement auto complete text box using AJAX. The text box suggests technical terms to
the users based on the keyword they entered into the input field.Suggest.html
<html>
<body>
<script>
Function ajax() {
If (window.XMLHttpRequest) {
Try {
}
Catch€ {}
Else if (window.ActiveXObject) {
Try {
Catch €{
Try{
Catch € {}
Return ajax;
Function request(str) {
myAjax.onreadystatechange = result;
myAjax.setRequestHeader(“Content-type”, “application/x-www-form-urlencoded”);
myAjax.send(“q=”+str);
Function result() {
If (myAjax.readyState == 4) {
// document.getElementById(‘tag_update’).style.display = “block”;
Function selected(choice){
Document.getElementById(‘tag_update’).style.display = “none”;
</script>
<div>
</div><div id=”tag_update”></div>
</form>
</body>
</html>
Autosuggest.php
<?php
If (isset($_GET[‘q’])) {
$a[]=”Server”;
$a[]=”Apache”;
$a[]=”IIS”;
$a[]=”HIS”;
$a[]=”HTTP Server”;
$a[]=”Tomcat”;
$a[]=”Perl”;
$a[]=”PHP”;
$a[]=”ASP”;
$a[]=”ASPX”;
$a[]=”Jsp”;
$a[]=”Application”;
$a[]=”Performance”;
$a[]=”Informatica”;
$a[]=”Documentum”;
$a[]=”Cognos”;
$a[]=”Sharepoint”;
$a[]=”Google”;
$a[]=”EssBase”;
$a[]=”Yahoo”;
$a[]=”Linux”;
$a[]=”Apple”;
$a[]=”Mozilla”;
$a[]=”Firfox”;
$a[]=”Chrome”;
$a[]=”Internet Explorer”;
$a[]=”Robots”;
$a[]=”Feeds”;
$a[]=”Websites”;
$a[]=”HTML”;
$a[]=”Xhtml”;
$q=$_GET[“q”];
$hint=””;
If (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
If ($hint==””)
Else
$hint=$hint.$add_me;
//$hint=$a[$i];
}
}
If ($hint == “”)
Else
$response=$hint;
Echo $response;
Exit;
?>