Professional Documents
Culture Documents
Practical: Savitribai Phule Pune Uiversity
Practical: Savitribai Phule Pune Uiversity
PRACTICAL
Video:
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls>
<source src="viideo.mp4" type="video/mp4">
<source src="viideo.WebM " type="video/WebM">
Your browser does not support the video tag.
</video>
</body>
</html>
Audio:
<!DOCTYPE html>
<html>
<body>
<h1>The audio element</h1>
<p>Click on the play button to play a sound:</p>
<audio controls>
<source src="ThousandYears.mp3" type="audio/wav">
<source src="ThousandYears.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>
2. program to design form using HTML5 elements,
attributes and semantics.
<!DOCTYPE html>
<html>
<body>
<h1>LOGIN PAGE</h1>
<form><br>
<label for="fname">Email Id: <br>
<input type="text" id="fname"><br>
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas"width="200" height="100"
style="border:1px solid black;"></canvas>
<svg width="400" height="210" >
<text x="0" y="20" fill="red"
transform="rotate(30,20,40)"> I Love SVG!</text>
</svg>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
<style>
h1 {
color: orange;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>The style of this document is a combination of an external
stylesheet, and internal style</p>
</body>
</html>
5. Implement Transformation using Translation , Rotation, And
Scaling in your web page
<!DOCTYPE html>
<html>
<head>
<style>
div.a {
width: 150px;
height: 80px;
background-color: yellow;
-ms-transform: rotate(20deg); /* IE 9 */
transform: rotate(20deg);
}
div.b {
width: 150px;
height: 80px;
background-color: yellow;
-ms-transform: skewY(20deg); /* IE 9 */
transform: skewY(20deg);
}
div.c {
width: 150px;
height: 80px;
background-color: yellow;
-ms-transform: scaleY(1.5); /* IE 9 */
transform: scaleY(1.5);
}
</style>
</head>
<body>
<h2>transform: rotate(20deg):</h2>
<div class="a">Hello World!</div>
<br>
<h2>transform: skewY(20deg):</h2>
<div class="b">Hello World!</div>
<br>
<h2>transform: scaleY(1.5):</h2>
<div class="c">Hello World!</div>
</body>
</html>
6. Program to show current date and time using user defined
model.
console.log(q.host);
console.log(q.pathname);
console.log(q.search);
console.log(qdata.month);
8. Program using NPM which will convert entered string into
either case
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
function myFunction() {
var str = "Hello World!";
var res = str.toUpperCase();
document.getElementById("demo").innerHTML = res;
}
</script>
</body>
</html>
9. Write a program to create a calculator using node JS.
//route - sum
server.route({
method: 'GET',
path: '/calculator/sum/{num1}+{num2}',
handler: function (request, h) {
var data = {
answer: num1 + num2
};
return data;
}
});
Subtraction:
//route - subtraction
server.route({
method: 'GET',
path: '/calculadora/sub/{num1}-{num2}',
handler: function (request, h) {
const num1 = parseInt(request.params.num1);
const num2 = parseInt(request.params.num2);
var data = {
resposta: num1 - num2
};
return data;
}
});
Multiplication:
//route - multiplication
server.route({
method: 'GET',
path: '/calculadora/multi/{num1}*{num2}',
handler: function (request, h) {
var data = {
resposta: num1 * num2
};
return data;
}
});
Division:
//route - division
server.route({
method: 'GET',
path: '/calculadora/div/{num1}/{num2}',
handler: function (request, h) {
var data = {
resposta: num1 / num2
};
return data;
}
});
}
<form name="myForm">
<input name="myInput" ng-model="myInput" required>
</form>
</body>
</html>
<hr>
<div ng-switch="myVar">
<div ng-switch-when="dogs">
<h1>Dogs</h1>
<p>Welcome to a world of dogs.</p>
</div>
<div ng-switch-when="tuts">
<h1>Tutorials</h1>
<p>Learn from examples.</p>
</div>
<div ng-switch-when="cars">
<h1>Cars</h1>
<p>Read about cars.</p>
</div>
<div ng-switch-default>
<h1>Switch</h1>
<p>Select topic from the dropdown, to switch the content of
this DIV.</p>
</div>
</div>
<hr>
</body>
</html>
<!DOCTYPE html>
<html>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/ang
ular.min.js"></script>
<body>
</div>
</body>
</html>
13. Create angular project which has html template and handle
the click event on click of the button
<!DOCTYPE html>
<html>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/ang
ular.min.js"></script>
<body>
<script>
var app = angular.module("myShoppingList", []);
app.controller("myCtrl", function($scope) {
$scope.products = ["Milk", "Bread", "Cheese"];
$scope.addItem = function () {
$scope.products.push($scope.addMe);
}
});
</script>
</body>
</html>
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>
</body>
</html>
15. Program to demonstrate session management using various
techniques.
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
// Echo session variables that were set on previous page
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>";
echo "Favorite animal is " . $_SESSION["favanimal"] . ".";
?>
</body>
</html>
<?php
class Database
{
private static $dbName = 'crud_tutorial' ;
private static $dbHost = 'localhost' ;
private static $dbUsername = 'root';
private static $dbUserPassword = 'root';
private static $cont = null;
public function __construct() {
die('Init function is not allowed');
}
public static function connect()
{
// One connection through whole application
if ( null == self::$cont )
{
try
{
self::$cont = new PDO( "mysql:host=".self::
$dbHost.";"."dbname=".self::$dbName, self::$dbUsername, self::
$dbUserPassword);
}
catch(PDOException $e)
{
die($e->getMessage());
}
}
return self::$cont;
}
public static function disconnect()
{
self::$cont = null;
}
}