PS LabManual
PS LabManual
1
Aim: Write HTML for demonstration of cascading stylesheets.
a. Embedded stylesheets.
b. External stylesheets.
c. Inline styles
Theory:
Program:
a. Embedded stylesheets.
<html>
<head>
<title>Embedded Style sheets</title>
<style>
body {background-color: pink;}
h1 {color:orange;
text-align:center;
}
p{
font-family: "Times New Roman";
font-size: 20px;
}
</style>
</head>
<body>
<h1>Embedded Style Sheets</h1><br>
<p>This is a paragraph
</body>
</html>
b. External stylesheets.
<html>
<head>
<title>External Style Sheets</title>
<link rel="stylesheet" href="external1.css">
</head>
<body>
<h1>External Style Sheets</h1><br>
<p>This is a paragraph
</body>
</html>
c. Inline styles
<html>
<head>
<title>HTML Tables</title>
</head>
<body bgcolor="pink">
<center>
<h1>Creating HTML Tables</h1><br>
<table border="2" cellpadding="4" cellspacing="4">
<tr>
<th colspan="2" style="background-color:red">
WebSites</th>
</tr>
<tr>
<th style="backgroundcolor:blue">MailSites</th>
<th style="backgroundcolor:green">JobSites</th>
</tr>
<tr>
<td style="background-color:grey">Gmail</td>
<td style="background-color:aqua">Naukri</td>
</tr>
<tr>
<td style="backgroundcolor:yellow">Yahoo</td>
<td style="backgroundcolor:purple">JobStreet</td>
</tr>
</table>
</center>
</body>
</html>
Output:
Result:
Practical No. 2
Theory:
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
background-color: #f0f5f3;
margin: 20%;
}
#title {
text-align: center;
text-shadow: 5px 5px 10px white;
font-size: 8vh;
}
img {
display: inline-block;
width: 100%;
}
#caption {
font-size: 19px;
font-family:sans-serif;
color: black;
}
div#tribute-data {
background-color: rgb(46, 139, 87, 0.25);
box-shadow: 20px 20px 20px #96c996;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
padding: 25px 25px;
margin: 11px;
margin-top: 50px;
}
h1.title-vk {
font-size: 35px;
color: white;
text-align: center;
text-shadow: 5px 6px 10px black;
}
</style>
</head>
<body>
<main id="main">
<!-- Title of the web page tributing virat kohli -->
<h1 id="title">
Virat Kohli - The Run Machine
</h1>
<div id="img">
<!--Image of the Virat kohli-->
<img src="vk.jpg" id="image"
alt="Error in the image">
<small id="caption">
Currently, Virat Kohli is the best batter in the world.
</small>
</div>
<div id="tribute-data">
<h1 class="title-vk">
About the Run Machine/King Kohli
</h1>
<p>
☛ Virat, a 13-year-old, is selected for the Delhi Under-15 team for the Polly
Umrigar Trophy in October. He ends the campaign as Delhi's leading scorer.<br><br>
☛ Virat is chosen for the India Under-19 team for the first time after making an
impression at the youth level for Delhi. He then had a fantastic tour of England, averaging
over 100 in the one-day series.<br><br>
☛ In Malaysia's Under-19 World Cup, Virat led India to win and finished the
competition as one of the top three run scorers. His innate leadership abilities attracted the
proper kind of attention.<br><br>
<br><br> ☛ Virat received his maiden call-up to the Indian ODI team and
participated in the entire five-match series against Sri Lanka on the road. In the fourth game
of the series, he hit his first 50, a 54-run inning.
<br><br> ☛ When Virat got his first ODI century against Sri Lanka, 107 off 111, it
was worth the wait for him to return to the national squad.
<br><br> ☛ Every cricketer will answer "play Test cricket" when asked what their
dream is. In 2011, Virat finally had the opportunity to play in his first Test match against the
West Indies. Unfortunately for the charming lad, it was a forgettable experience as he scored
just 19 runs in the two innings he played.
<br><br> ☛ In the fourth and final test against Australia in Adelaide, Kohli
achieved his first test hundred under somewhat dramatic circumstances. He just avoided
being run out when batting with Ishant Sharma and nearly ran out of partners. However, he
was unable to save India. 4-0 was our series loss.
<br><br> ☛ Virat led India to the CB Series final in Australia with what is
undoubtedly one of the best ODI efforts by an Indian batsman, hitting 133 not out against Sri
Lanka off just 86 balls. Hobart witnessed one of the greatest batting performances in history
as India, who was chasing 321, reached the score in 37 overs.
<br><br> ☛ In place of an injured MS Dhoni, Virat was selected the stand-in ODI
captain when India visited the West Indies. Earlier that year, he had also been named captain
of his IPL team, the Royal Challengers Bangalore.
<br><br> ☛ In addition to purchasing a share in the IPTL team UAE Royals, Kohli
expanded his interest in tennis after becoming a co-owner of ISL football club FC Goa the
year before.
<br><br> ☛ He produced arguably his finest innings of his young career as India
defeated Australia in Mohali to go to the ICC World T20 semifinals. As opposed to the lappa
kind of cricket that is typically associated with 20 over cricket, his 82 off 51 balls was a
magnificent effort, carved with timing and technique.
<br><br>
</p>
</div>
<br>
</main>
</body>
</html>
Output:
Result:
Practical No. 3
Theory:
Program:
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<meta name="viewport" content "width=device-width, initial-scale=1.0">
<title>HTML Project</title>
</head>
<body>
<!--Header(start)-->
<table id="header" border="0" width="100%"
cellpadding="0" cellspacing="0" bgcolor="#4CAF50">
<tr>
<td>
<table border="0" cellpadding="15"
cellspacing="0" width="90%" align="center">
<tr>
<td>
</td>
<td>
<font face="Comic sans MS" size="6">
<b>GeeksForGeeks</b>
</font>
</td>
<td width="15%">
</td>
<td>
<a href="#home" style="text-decoration:none">
<font face="Verdana" size="5" color=black>
Home
</font>
</a>
</td>
<td>
|
</td>
<td>
<a href="#about" style="text-decoration:none">
<font face="Verdana" size="5" color=black>
About
</font>
</a>
</td>
<td>
|
</td>
<td>
<a href="#projects" style="text-decoration:none">
<font face="Verdana" size="5" color=black>
Projects
</font>
</a>
</td>
<td>
|
</td>
<td>
<a href="#achievements" style="text-decoration:none">
<font face="Verdana" size="5" color=black>
Achievements
</font>
</a>
</td>
<td>
|
</td>
<td>
<a href="#contact" style="text-decoration:none">
<font face="Verdana" size="5" color=black>
Contact
</font>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Header(end)-->
<!--Home(start)-->
<table id="home" border="1" width="100%"
cellpadding="20" cellspacing="0" bgcolor="black">
<tr>
<td>
<table border="0" cellpadding="15"
cellspacing="0" width="90%" align="center">
<tr>
<td align="center" valign="middle">
<h3>
<font face="Times New Roman"
size="6" color="#ffffff">
Hi Geeks!
</font>
</h3>
<h2>
<font face="Verdana" size="6"
color="#4CAF50">
<!-- Freelance Programmer -->
</font>
</h2>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Home(end)-->
<!--About(start)-->
<table id="about" border="0" width="100%"
cellpadding="0" cellspacing="0" bgcolor="black">
<tr>
<td>
<table border="0" cellpadding="15"
cellspacing="0" width="80%" align="center">
<tr>
<td height="180" align="center"
valign="middle" colspan="2">
<font face="Verdana" size="7"
color="#4CAF50">
About Me
</font>
<hr color="#4CAF50" width="90">
</td>
</tr>
<tr>
<td width="40%">
<img src="img.png">
</td>
<td width="60%">
<font face="Verdana" size="4"
color="white">
Thanks for your interest, here
is a quick story of me and this
website.
<hr color="black">
Sandeep Jain An IIT Roorkee alumnus
and founder of GeeksforGeeks. He
loves to solve programming problems
in most efficient ways. Apart from
GeeksforGeeks, he has worked with
DE Shaw and Co. as a software
developer and JIIT Noida as an
assistant professor.
<hr color="black">
I do my work mainly in C-Language,
C++ and JAVA. C++ and Data Structure
& Algorithm are my stronger section.
Besides these I know Web Development,
LINUX and database as well.
<hr color="black">
<tr>
<td height="10">
<font face="Times New Roman"
size="5" color="black">
<ul>
<li>
BMI Calculator
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Calculator
<a href="#" style="text-decoration:none"
color="#c2c0c3">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Calendar
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
ChatBot
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Contact Saver
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Daily Quiz
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Emplyoyee Record System
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Guess the Number-Game
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Random Password Generator
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Stone Paper Scissor
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Tic Tac Toe
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
Tic Tac Toe(GUI)
<a href="#" style="text-decoration:none">
➲
</a>
</li>
<li>
<hr color="#c2c0c3">
ToDo App
<a href="#" style="text-decoration:none">
➲ </a>
</li>
<li>
<hr color="#c2c0c3">
Travel Management System
<a href="#" style=
"text-decoration:none"> ➲
</a>
</li>
</ul>
<hr color="#c2c0c3">
<hr color="#c2c0c3">
<hr color="#c2c0c3">
<hr color="#c2c0c3">
</font>
</td>
<td width="45%">
<img src="img.png" alt="Project" width="75%">
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Projects(end)-->
<!--Achievement(start)-->
<table id="achievements" border="0" width="100%"
cellpadding="0" cellspacing="0" bgcolor="black">
<tr>
<td>
<table border="0" cellpadding="15"
cellspacing="0" width="80%" align="center">
<tr>
<td height="180" align="center" valign="middle">
<font face="Verdana" size="7" color="#4CAF50">
Achievements
<hr color="#4CAF50" width="100">
</font>
</td>
</tr>
<tr>
<td>
<font face="Verdana" size="4" color="white">
<ul>
<li>
<b>Intern at GeeksforGeeks.</b>
<ul>
<li>
December,2020 - Present.
</li>
<li>
Write technical articles
on programming related topics.
</li>
</ul>
</li>
<li>
<hr color="black">
<hr color="black">
<hr color="black">
<b>Microsoft Learn Student Ambassador.</b>
<ul>
<li>
August,2020 - Present.
</li>
<li>
Conducted events and workshops on
different technologies.
</li>
</ul>
</li>
<li>
<hr color="black">
<hr color="black">
<hr color="black">
<b>Mentored HackTX.</b>
<ul>
<li>
October,2020.
</li>
<li>
Selected from Microsoft as Student
ambassador where I mentored students
in their projects.
</li>
<hr color="black">
<hr color="black">
<hr color="black">
<hr color="black">
<hr color="black">
</ul>
</li>
</ul>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Achievement(end)-->
<!--Contact(start)-->
<table id="contact" border="0" width="100%"
cellpadding="0" cellspacing="0" bgcolor="#c2c0c3">
<tr>
<td>
<table border="0" cellpadding="15"
cellspacing="0" width="80%" align="center">
<tr>
<td height="180" align="center"
valign="middle" colspan="2">
<font face="Verdana" size="7"
color="black">
Contact
</font>
<hr color="black" width="90">
</td>
</tr>
<tr>
<td align="center" valign="top">
<table border="0" width="50%" cellpadding="15"
cellspacing="0" align="center" bgcolor="black">
<tr>
<td width="30%">
<hr color="black">
<font face="Verdana" size="4"
color="#ffffff">
Name
</font>
</td>
<td width="70%">
<font face="Verdana" size="4"
color="#ffffff">
<input type="text" size="40">
</font>
</td>
</tr>
<tr>
<td width="30%">
<font face="Verdana" size="4"
color="#ffffff">
Email
</font>
</td>
<td width="70%">
<font face="Verdana" size="4"
color="#ffffff">
<input type="email" size="40">
</font>
</td>
</tr>
<tr>
<td width="30%">
<font face="Verdana" size="4"
color="#ffffff">
Number
</font>
</td>
<td width="70%">
<font face="Verdana" size="4"
color="#ffffff">
<input type="number" size="12">
</font>
</td>
</tr>
<tr>
<td width="30%">
<font face="Verdana" size="4"
color="#ffffff">
Message
</font>
</td>
<td width="70%">
<font face="Verdana" size="4"
color="#ffffff">
<textarea rows="5"
cols="37">
</textarea>
</font>
</td>
</tr>
<tr>
<td width="30%">
</td>
<td width="70%">
<button type="Submit">
<font face="Verdana"
size="4" color="black">
<b>Submit</b>
</font>
</button>
<hr color="black">
<hr color="black">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Contact(end)-->
<!--Footer1(start)-->
<table id="footer" border="0" width="100%"
cellpadding="0" cellspacing="0" bgcolor="#4CAF50">
<tr>
<td>
<table border="0" cellpadding="15"
cellspacing="0" width="90%" align="center">
<tr>
<td width="13%" valign="top">
<b>LinkedIn</b>
<a href="#" style="text-decoration:none">
➲
</a>
</td>
<td>
|
+ </td>
<td>
|
</td>
<td>
|
</td>
<td>
|
</td>
<td>
|
</td>
<td>
|
</td>
<td>
|
</td>
<!--Footer2(start)-->
<table id="footer" border="0" width="100%"
cellpadding="0" cellspacing="0" bgcolor="black">
<tr>
<td>
<table border="0" cellpadding="15"
cellspacing="0" width="90%" align="center">
<tr>
<td width="80%" valign="top">
<font face="Verdana"
color="#4CAF50" size="5">
©Copyright 2050 by nobody.
All rights reserved.
</font>
</td>
<td width="10%">
<font face="arial" color="black" size="5">
<a href="#header" style="text-decoration:none">
<font face="Verdana" color="#4CAF50" size="6">
<b>TOP ☝</b>
</font>
</a>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--Footer2(end)-->
</body>
</html>
Output:
Result:
Practical No. 4
Theory:
Program:
<html>
<body>
<script>
function validateform(){
var name=document.myform.name.value;
var password=document.myform.password.value;
if (name==null || name==""){
alert("Name can't be blank");
return false;
}else if(password.length<6){
alert("Password must be at least 6 characters long.");
return false;
}
}
</script>
<body>
<form name="myform" method="post"
action="http://www.javatpoint.com/javascriptpages/valid.jsp" onsubmit="return
validateform()" >
Name: <input type="text" name="name"><br/>
Password: <input type="password" name="password"><br/>
<input type="submit" value="register">
</form>
</body>
</html>
OUTPUT:
RESULT:
PRACTICAL NO.5
Aim: Write an XML for student information and access second students data using DOM
Theory:
Xml
Dom
PROGRAM:
school.xml:
<?xml version="1.0"?>
<school>
<class>
<class_title>XML</class_title>
<students>
<student>
<firstname>aaa</firstname>
<lastname>bbb</lastname>
</student>
<student>
<firstname>aaa</firstname>
<lastname>bbb</lastname>
</student>
</students>
</class>
</school>
school2.html:
<html>
<head>
<title>Accessing XML data</title>
<script type="text/javascript">
function getStudentData()
{
var xmldoc;
xmldoc=new ActiveXObject("Microsoft.XMLDOM");
xmldoc.load("pract5_a.xml");
nodeSchool=xmldoc.documentElement;
nodeClass=nodeSchool.firstChild;
nodeStudents=nodeClass.lastChild;
nodeStudent=nodeStudents.lastChild;
nodeFirstname=nodeStudent.firstChild;
nodeLastname=nodeFirstname.nextSibling;
message.innerHTML="Name:"+nodeFirstname.firstChild.nodeValue+"
"+nodeLastname.firstChild.nodeValue;
}
</script>
</head>
<body bgcolor="pink">
<center>
<h1>Accessing XML Data</h1>
<div id="message"></div>
<input type="button" value="GET DATA" onClick="getStudentData()">
</center>
</body>
</html>
OUTPUT:
RESULT:
PRACTICAL NO.6
THEORY:
PROGRAM:
<html>
<head>
<script type = "text/javascript" src = "MooTools-Core-1.6.0.js"></script>
<script type = "text/javascript" src = "MooTools-More-1.6.0.js"></script>
//methods
initialize: function(widthVal, heightVal) {
this.width = widthVal;
this.height = heightVal;
},
details: function() {
document.write("Welcome to MooTools demo program");
document.write("Width: "+this.width+" Height: "+this.height);
},
});
var rec = new Rectangle(5,4);
rec.details();
</script>
</head>
<body>
</body>
</html>
OUTPUT:
RESULT:
PRACTICAL NO. 7
THEORY:
PROGRAM:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial: Hello Dojo!</title>
</head>
<body>
<h1 id="greeting">Hello</h1>
<!-- load Dojo -->
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"
data-dojo-config="async: true"></script>
</body>
</html>
OUTPUT:
RESULT:
PRACTICAL NO.8
THEORY:
PROGRAM:
<!DOCTYPE>
<html>
<body>
<?php
echo "<h2>Hello First PHP</h2>";
?>
</body>
</html>
OUTPUT:
RESULT:
PRACTICAL NO. 9:
THEORY:
PROGRAM:
<?php
$host = 'localhost:3306';
$user = '';
$pass = '';
$conn = mysqli_connect($host, $user, $pass);
if(! $conn )
{
die('Could not connect: ' . mysqli_error());
}
echo 'Connected successfully';
mysqli_close($conn);
?>
OUTPUT:
RESULT:
PRACTICAL NO. 10
THEORY:
Zend is an open source PHP framework. It is pure object-oriented and built around the MVC
design pattern. Zend framework contains collection of PHP packages which can be used to
develop web applications and services. Zend was started by Andi Gutmans and Zeev
Suraski. This tutorial will give you a quick introduction to Zend Framework and make you
comfortable with its various components.
To install the Zend Framework, we must first install the Composer and the latest version of
PHP as shown in the following steps.
Install Composer − Zend uses Composer for managing its dependencies, so make sure
you have the Composer installed on your machine. If the Composer is not installed, then
visit the official website of Composer and install it.
Install the latest version of PHP − To get the maximum benefit of Zend Framework,
install the latest version of PHP. The minimum required version for the Zend
Framework 3 is PHP 5.6 or later.
Install Zend Framework
Zend Framework can be installed in two ways. They are as follows −
Manual installation
Composer based installation
Let us discuss both these installations in detail.
Manual Installation
Download the latest version of Zend Framework by visiting the following link
– https://framework.zend.com/downloads/archives
Extract the content of the downloaded archive file to the folder you would like to keep it. Once
you have a copy of Zend Framework available in your local machine, your Zend Framework
based web application can access the framework classes. Though there are several ways to
achieve this, your PHP include_path needs to contain the path to the Zend Framework classes
under the /library directory in the distribution. This method applies to Zend Framework version
2.4 and earlier only.
Output:
Result: