Вы находитесь на странице: 1из 46

Roll No:- 18-311

Name :- atul
harish dewarkar
Class:-SYCS
Practical No.1
Aim :-
A) Design a web page that makes use of document structure tags.

Code:-

<html>
<head>
<title>Document Structure tag</title>
<center>This is my Head section
<p><b> Hello</b> </p>
</center>
</head>
<body>
<center>This is my Body section
<p>
<b>Programmer</b></p>
</center>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

b)Design a web page that makes use of various text formatting tags.
Code:-

<html>
<head>
<title>Different text formatting tag</title>
</head>
<body>
<h1>This is my heading</h1>
<p><i>My name is Suraj Haldankar</i></p>
<p><b><u>Mumbai</u></b> City of dream</p>
<p>The chemical formula for water is H<sub>2</sub>o</p>
<p><kbd>Press Enter</kbd></p>
<p>
<strong>Now i am using Strong tag</strong></p>
<p>The power of 2<sup>10</sup>=1024</p>
<h4>
<q>Now reducing header size to h4</q></h4>
<p>I am a student of SYCS <del> LECTURE</del></p>
<p>Capital of
<mark>India's</mark>capital is <mark>Delhi</mark></p>
<h6>
<q>Now reducing header size to h6</q></h6>
<p>AI is artificial intelligence

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
<blockquote>which is not to understand how to human think also build such entities </blockquote></p>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

C) Design a web page that makes use of list tags.


<html>
<body>
<ol>
<h1> Order list</h1>
<h3>Subject Name</h3>
<li> Theory of Computation</li>
<li>Operating System</li>
<li>Web Programming</li>
<li>Combination and graph Theory</li>
<li>Core Java</li>
<li>Internet of thing</li>
<li>Database Management System</li></ol>
<h1> Unorder list</h1>
<h2>Grocery list</h2><ul>
<li>Bread</li>
<li>Eggs</li>
<li>Milk</li>
<li>Coffee</li></ul>
<h1> Description list</h1>
<dt>HTML</dt>
<dd>Hypertext Markup Language</dd>
<dt>ASCII</dt>
<dd>American Standard code for Information Interchange</dd><dt>DDL</dt>
<dd>Data Definition Language</dd>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
<dt>DML</dt><dd>Data Manipulation Language</dd>
</body></html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(D)Aim: Design a web page that makes use of Image and Image maps.
Code:-
<html>
<head></head>
<body>
<map name="Ruks">
<area shape="rec" coords="22 65 110 155" href="2nd.html"/>
<area shape="circle" coords="176 137 48" href="2nd.html"/>
</map>
<img src="C:\Users\Admin\Desktop\shapes.jpg" usemap="#Ruks" />
</body>
</html>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Practical No.2
A) Aim :- Design a web page that makes use of Table tags.
Code:-
<html>

<head></head>

<body>

<table border="2">

<tr><th>10 July 2019</th></tr>

<tr >

<th colspan="2"><p>pay to </p>

<p>Acme Billing co</P>

<p>123 Main st</p>

<p>Cityville,NA,12345</p></th>

<th colspan="2"><p>Customer</p>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
<p>John Smith</p>

<p>321 wilow wxy</p>

<p>Southest Northest</p>

<p>ershire MA,54321</p></th>

</tr>

<tr>

<td>Name/Description</td>

<td>Qty</td>

<td>@</td>

<td>Cost</td>

</tr>

<tr>

<td>Papeclips</td>

<td>1000</td>

<td>0.01</td>

<td>10.00</td>

</tr>

<tr>

<td>Staples(box)</td>

<td>100</td>

<td>1.00</td>

<td>10000</td>

</tr>

<tr>

<td>110.00</td>

</tr>

<tr>

<td>8%</td>
Professor :-shweta . Signature:-. .
Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
<td>8.80</td>

</tr>

<tr>

<td>$118.80</td>

</tr>

</body>

</html>

Output :-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

b) (B)Aim: Design a web page that makes use of Form tags.


Code:-
<!DOCTYPE html>
<html>
<body>
<form>
<h2>Text Input</h2>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
<br>
<h2>Select Gender</h2>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other<br>
<h2>Select Languages Known</h2>
<input type="checkbox" name="lang" value="Java"> Java<br>
<input type="checkbox" name="lang" value="PHP" checked="checked"> PHP<br>
<input type="checkbox" name="lang" value="C#"> C#<br>
<input type="checkbox" name="lang" value="Python" checked="checked"> Python<br>
<input type="checkbox" name="lang" value="Ruby"> Ruby<br>
<br><br>
<input type="submit" value="Submit">

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
</form>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

c) Aim: Design a web page that makes use of Navigation across multiple pages.
Code:-
File:q2b.html
<html>
<head></head>
<body>
<form action="C:\Users\Admin\Desktop\form2.html">
<p>User name<input type="text" maxlength="20" size="10"/></p>
<p>Password<input type="password" maxlength="20" size="5"/></p>
<p><input type="submit" size="10"/>
<input type="reset" size="10"/></p>
</form>
</body>
</html>

File:form2.html
<html>
<head></head>
<body>
<p>Select the Gender</p>
<form action="C:\Users\Admin\Desktop\form3.html">
<input type="radio" name="r1" />Male

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
<input type="radio" name="r1" />Female
<p>Select the country</p>
<select>
<option value="India">India</option>
<option value="USA">USA</option>
<option value="England">England</option>
<option value="Saudi">Saudi</option>
</select>
<p><input type="Submit" size="5"/>
<input type="Reset" size="5"/>
</form>

File:form3.html
<html>
<head></head>
<body>
<p>Select the states</p>
<form action="C:\Users\Admin\Desktop\form4.html">
<p><input type="checkbox"/>Maharashtra</p>
<p><input type="checkbox"/>UP</p>
<p><input type="checkbox"/>MP</p>
<p><input type="checkbox"/>HP</p>
<p><input type="checkbox"/>Delhi</p>
<p><input type="Submit" /></p>
</form>
</body></html>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
File: form4.html
<html>
<head></head>
<body>
<p>We are done with the form filling process</p>
</body></html>

Output:-
Page 1

Page 2

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Page 3

Page 4

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(D)Aim: Design a web page that makes use of Embedded multimedia elements.
Code:-
(1) Video:
<html>
<head></head>

<body>

<video src="C:\Users\Admin\Downloads\Big_Buck_Bunny_1080_10s_1MB.mp4" autoplay="true" controls="true"


loop="true">

</video>

</body>

</html>

(2)Audio:
html>
<head></head>
<body>
<audio src= "C:\Users\Admin\Downloads\02 First Class - Kalank.mp3" autoplay="true" controls="true">
</audio>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Practical No.3

(A)Aim: Design a web page that makes use of Cascading Style Sheet with CSS
properties to change the background of a page.

Code:-
File:Tabletag.html
<html>
<head><link href="myfile.css" type="text/css" rel="stylesheet">
</link>
</head>
<body>
<table border="2">
<tr>
<th>Name</th>
<th>Roll No</th>
<th>Address</th>
</tr>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
<tr>
<td>Rukaiya</td>
<td>320</td>
<td>Sakinaka</td>
</tr>
<tr>
<td>Akshata</td>
<td>323</td>
<td>Ghatkopar</td>
</tr>
<tr>
<td>Sushmita</td>
<td>310</td>
<td>Kurla</td>
</tr>
</table>
</body>
</html>

File:myfile.css
th
{
background-color:blue;
}
td

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
{
background-color:yellow;
}
body
{
background-repeat:repeat-x;
border-bottom:dotted;
border-top:dotted;
border-right:dotted;
border-left:dotted;
background-image:url("home.jpg");
}

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(B)Aim: Design a web page that makes use of Cascading Style Sheet with CSS
properties to change fonts and text styles.
Code:-

File:Tabletag.html
<html>
<head><link href="myfile.css" type="text/css" rel="stylesheet">
</link>
</head>
<body>
<table border="2">
<tr>
<th>Name</th>
<th>Roll No</th>
<th>Address</th>
</tr>
<tr>
<td>Rukaiya</td>
<td>320</td>
<td>Sakinaka</td>
</tr>
<tr>
<td>Akshata</td>
<td>323</td>
<td>Ghatkopar</td>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
</tr>
<tr>
<td>Sushmita</td>
<td>310</td>
<td>Kurla</td>
</tr>
</table>
</body>
</html>

File: myfile.css
h2
{
font-style:italic;
background-color:green;
}
th
{
background-color:blue;
}
td
{
background-color:pink;
}
table
{
Professor :-shweta . Signature:-. .
Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
font-size:35px;
font-style:italic;
font-color:yellow;
}

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Practical No.4
(A)Aim: Write a javascript code for performing various maths operations such as
calculating Factorial or Fibonacci series or Displaying prime numbers in given
range or finding even odd of a number.
Code:-
(1)To find the factorial of a number:
<html>
<body>
<script>
var n=prompt("Enter a number:");
var f=1;
for(i=1;i<=n;i++)
{
f=f*i;
}
document.write(f);
</script>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(2)Fibonacci series:
<html>
<head>
<script type="text/javascript">
var t1=0;
var t2=1;
var t3;
var a=prompt("enter the value");
for(var i=3;i<=a;i++)
{
Professor :-shweta . Signature:-. .
Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
t3=t1+t2;
t1=t2;
t2=t3;
document.write(t3+"<br/>");
}
</script>
</head></html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Practical No.5
(A)Aim: Write javascript code for demonstrating different javascript object such
as RegExp,String,math and date.

Code:-
(1)String object:
<html>
<head><h1>Working with string object</h1></br></head>
<body>
<script type="text/javascript">
var Mystring="Twinkle Twinkle little star";
document.write("1.String:" + Mystring +"</br>");
document.write("2.Length:" + Mystring.length +"</br>");
document.write("3.Bold text:" + Mystring.bold() +"</br>");
document.write("4.UpperCase text:" + Mystring.toUpperCase() +"<BR/>");
document.write("5.Big text:" + Mystring.big() +"</br>");
document.write("6.LowerCase text:" + Mystring.toLowerCase() +"<BR/>");

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
document.write("7.Strike:" + Mystring.strike() +"</br>");
document.write("8.Small text:" + Mystring.small() +"<BR/>");
document.write("9.SubString after a character:" + Mystring.substring(5) +"</br>");
document.write("10.SubString after a character using substr():" + Mystring.substr(0,5) +"</br>");
document.write("11.Splitted text:" + Mystring.split('Twinkle') +"</br>");
document.write("12.Index of text:" + Mystring.indexOf('Twinkle') +"</br>");
document.write("13.Character at 8th position:" + Mystring.charAt(8) +"</br>");
document.write("14.Blinking of text:" + Mystring.blink() +"</br>");
</script>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(2)Number object:
<html>

<head>

<h2>Working with Number object</h2>

<body>

<script >

num=new Number('15.603');

document.write(num.toExponential()+"<br/>");

document.write(num.toFixed()+"<br/>");

document.write(num.toString()+"<br/>");

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
document.write(num.toPrecision()+"<br/>");

</script>

</body>

</html>

Output:-

3)Math object:

<html>

<head><h2>Working with math object</h2>

</head>

<body>

<script>

document.write("Floor:"+Math.floor(12.6)+"<br/>");

document.write("Log:"+Math.log(12.6)+"<br/>");

document.write("Maximum:"+Math.max(12,34,87,15)+"<br/>");

document.write("Minimum:"+Math.min(12,5,16,2)+"<br/>");

document.write("Power:"+Math.pow(10,3)+"<br/>");

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
document.write("Random:"+Math.random()+"<br/>");

</script>

</bodt>

</html>

Output:-

(4)Date object:
Code:-

<html>
<head><h1>Date Object</h1></head>
<body>
<script type="text/javascript">
var a=new Date()

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
document.write(a.getDate()+"<br/>");
document.write(a.getMonth()+"<br/>");

document.write(a.getTime()+"<br/>");
document.write(a.getSeconds()+"<br/>");
document.write(a.getHours()+"<br/>");

</script>
</body>
</html>

Output:-

(B)Aim: Write javascript code for demonstrating different javascript


objects such as window,navigator,history,location and document.

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
Code:-
(1)Navigator object:
<html>
<head></head>
<body>
<h2>java Script Navigator Object</h2>
<script>
document.write("<br/>navigator.appCodName:"+navigator.appCodeName);
document.write("<br/>navigator.cookieEnabled:"+navigator.cookieEnabled);
document.write("<br/>navigator.userAgent:"+navigator.userAgent);
document.write("<br/>navigator.appName:"+navigator.appNAme);
document.write("<br/>navigator.appVersion:"+navigator.appVersion);
document.write("<br/>navigator.platform:"+navigator.platform);
document.write("<br/>navigator.language:"+navigator.language);
document.write("<br/>navigator.onLine:"+navigator.onLine);
</script>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(2)History object:
<html>
<head>
<script>
function goBack()
{
window.history.back()
}
</script>
</head>
<input type="button" value="Back" onclick="goBack()">
</body></html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(3)Location object:-
<html>
<body>
<input type="button"value="Replace URL"onclick="myFun()"/>
<script type="text/javascript">
functionmyFun()
{
location.replace("http://www.google.com")
}
</script>
</body>
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Practical-6:
(A)Aim: Create an XML file with external DTD and CSS .
Code:-
File:ExternalDtd.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="cssemp.css"?>
<!DOCTYPE emp [
<!ELEMENT emp (fname,lnae,email)>
<!ELEMENT fname (#PCDATA)>
<!ELEMENT lname (#PCDATA)>
<!ELEMENT email (#PCDATA)>
]>
<emp>
<fname>Priya</fname>
<lname>Sharma</lname>
<email>Priya@gmail.com</email>
</email>

File:cssemp.css

emp
{
Background-color:lightblue;
}
fname,lname,email
{
font-size:25px;

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
display:block;
color:navy;
margine-left:50px;
}

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

(B)Aim: Create an XML file with external DTD and display it using XSL.
Code:-
File:Students.dtd
<?xml version="1.0"?>
<!ELEMENT students (student+)>
<!ELEMENT student (name,address)>
<!ELEMENT name (fname,lname)>
<!ELEMENT fname (#PCDATA)>
<!ELEMENT lname (#PCDATA)>
<!ELEMENT address (street,city,email,phone)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT phone (#PCDATA)>

File:Students.dtd
<?xml version="1.0"?>
<!DOCTYPE students SYSTEM "students.dtd">
<?xml-stylesheet type="text/xsl" href="student.xsl"?>
<students>
<student>
<name>
<fname>James</fname>
<lname>Smith</lname>
</name>
Professor :-shweta . Signature:-. .
Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
<address>
<street>101 South Street</street>
<city>Halifax</city>
<email>james@gmail.com</email>
<phone>1476675448</phone>
</address>
</student>
<student>

File:Students.xsl
<?xml version="1.0"?>
<xsl:stylesheet version="1.0">
<xsl:template match="/">
<h2>Student record</h2>
<xsl:for-each select="students/student">
<br/>
<span style="font-weight:bold;color:blue">FirstName:</span>
<xsl:value-of select="name/fname"/>
<span style="font-weight:bold;color:blue">LastName:</span>
<xsl:value-of select="name/lname"/><br/>
<span style="font-weight:bold;color:green">Street:</span>
<xsl:value-of select="address/street"/><br/>
<span style="font-weight:bold;color:green">City:</span>
<xsl:value-of select="address/city"/><br/>
<span style="font-weight:bold;color:green">Email:</span>
<xsl:value-of select="address/email"/><br/>
<span style="font-weight:bold;color:green">Phone:</span>
<xsl:value-of select="address/phone"/><br/>
</xsl:for-each>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
</xsl:template>
</xsl:stylesheet>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS

Practical-7:
(A)Aim: Write a PHP script for retrieving form data.
Code:-
File: wlcPhpfile.html

<html>
<body>
<form action="userform.php" method="post">
Name:<input type="text" name="name"><br/>
Email:<input type="text" name="email"><br/>
<input type="submit">
</form>
</body>
</html>

File:userform.php
<html>
<body>

Welcome <?php echo $_POST["name"]; ?><br>


Your email address is: <?php echo $_POST["email"]; ?>

</body>

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
</html>

Output:-

Professor :-shweta . Signature:-. .


Roll No:- 18-311
Name :- atul
harish dewarkar
Class:-SYCS
(B)Aim: Create a PHP program for calculating the factorial of a number.
Code:-
File: factorial.php
<?php
$num = 4;
$factorial = 1;
for($x=$num; $x>=1; $x--)
{
$factorial=$factorial* $x;
}
echo "Factorial of $num is $factorial";
?>

Output:-

Professor :-shweta . Signature:-. .