HTML Lab Programs(MCA)
HTML Lab Programs(MCA)
<html >
<head>
<title>
</title>
</head>
<li>potatoes
<li>tomatoes
<li>cucumber
<li>bittergaurd
<li>bottlegaurd
<li>snakegaurd
<li>chillies
</ol>
<li>potatoes
<li>tomatoes
<li>cucumber
<li>bittergaurd
<li>bottlegaurd
<li>snakegaurd
<li>chillies
</ol>
<li>potatoes
<li>tomatoes
<li>cucumber
<li>bittergaurd
<li>bottlegaurd
<li>snakegaurd
<li>chillies
</ul>
<li>potatoes
<li>tomatoes
<li>cucumber
<li>bittergaurd
<li>bottlegaurd
<li>snakegaurd
<li>chillies
<ol type='a'>
</ol>
</ul>
</body>
</html>
Out put:
GREEN KART
ordered list
1. Potatoes
2. Tomatoes
3. Cucumber
4. Bittergaurd
5. Bottlegaurd
6. Snakegaurd
7. Chillies
Unordere List
d
potatoes
tomatoes
cucumber
bittergaurd
bottlegaurd
snakegaurd
chillies
a. green chillies
b. red chillies
<html>
<head>
<title>
</title>
</head>
<body>
<table border="3" align="center">
<tr>
</tr>
<tr>
<th rowspan="2">sno</th>
<th rowspan="2">sname</th>
<th colspan="5">marks</th>
</tr>
<tr>
<th>m1</th>
<th>m2</th>
<th>m3</th>
<th>m4</th>
<th>m5</th>
</tr>
<tr>
<td>1</td>
<td>Ramau</td>
<td>60</td>
<td>70</td>
<td>80</td>
<td>70</td>
<td>80</td>
</tr>
<tr>
<td>2</td>
<td>Raju</td>
<td>55</td>
<td>70</td>
<td>80</td>
<td>75</td>
<td>85</td>
</tr>
<tr>
<td>3</td>
<td>Rani</td>
<td>65</td>
<td>75</td>
<td>85</td>
<td>95</td>
<td>85</td>
</tr>
</table>
</body>
</html>
Out put :
student marks
marks
sno sname m1 m2 m3 m4 m5
1 Ramau 60 70 80 70 80
2 Raju 55 70 80 75 85
3 Rani 65 75 85 95 85
<head>
<title>
Demo on Forms
</title>
</head>
<body>
<form>
<h3>
<input type = "text" name = "fullname" value ="" size ="30" maxlength =
"30">
<br>
<br>
Father's Name
<input type = "text" name = "fname" value = "" size = "30" maxlength =
"30">
<br>
<br>
Mother'sName
<input type = "text" name = "mname" value = "" size = "30" maxlength =
"30" >
<br>
<br>
<fieldset>
<legend>
<font size="4">GENDER</font>
</legend>
</fieldset>
<fieldset>
<legend>
</legend>
<label>
<option>
<option> 1</option>
<option> 2 </option>
<option> 3</option>
<option> 4 </option>
<option> 5</option>
<option> 6</option>
<option> 7</option>
<option> 8</option>
<option> 9</option>
<option> 10</option>
<option> 11</option>
<option> 12</option>
<option> 13</option>
<option> 14</option>
<option> 15</option>
<option> 16</option>
<option> 17</option>
<option> 18</option>
<option> 19</option>
<option> 20</option>
<option> 21</option>
<option> 22</option>
<option> 23</option>
<option> 24</option>
<option> 25</option>
<option> 26</option>
<option> 27</option>
<option> 28</option>
<option> 29</option>
<option> 30</option>
<option> 31</option>
</select>
</label>
<label>
<option>
<option> 1</option>
<option> 2 </option>
<option> 3</option>
<option> 4 </option>
<option> 5 </option>
<option> 6</option>
<option> 7</option>
<option> 8</option>
<option> 9</option>
<option> 10</option>
<option> 11</option>
<option> 12</option>
</select>
</label>
<label>
<option> 1995</option>
<option> 1996</option>
<option> 1997</option>
<option> 1998</option>
<option> 1999</option>
<option> 2000</option>
<option> 2001</option>
<option> 2002</option>
<option> 2003</option>
<option> 2004</option>
<option> 2005</option>
</select>
<label>
</fieldset>
<fieldset>
<legend>
<font size="4">Address</font>
</legend>
<label>
</textarea></label>
</fieldset>
<br>
<br>
Nationality
<br>
<br>
Catogery
<input type = "text" name = "catogery" value = "" size = "20" maxlength
="20" >
<br>
<br>
<hr>
<br>
Personal Information
<br>
Hobbies
<input type = "text" name = "hobbie" size = "20" maxlength = "25" >
<br>
<br>
Blood Group
<option>
<option> A+</option>
<option> A-</option>
<option> B+</option>
<option> B-</option>
<option> O+</option>
<option> O-</option>
<option> AB+</option>
<option> AB-</option>
</select>
<br>
<br>
<fieldset>
<legend>
<font size="4">PHC</font>
</legend>
</fieldset>
<br>
<br>
</h3>
</Form>
</Body>
</Html>
Out put :
4. Write html programs to demonstrate different types of style sheets
<html>
<body>
</body>
</html>
Out put:
<html>
<head>
<style type=”text/css”>
h1
Font-family:tahoma;
background:black;
color:white;
{
font-family:arial;
font-size:20pts;
p.color
color:blue;
</style>
</head>
<body>
<h1>normal Font</h1><br>
</body>
</html>
Out put:
normal Font
first paragraph
second paragraph
C. External
<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”extern.css”>
</head>
<body>
<h1>heading tag</h1>
</body>
</html
extern.css:
h1
font-family:tahoma;
background:black;
color:white;
font-family:arial;
font-size:20pts;
p.color
color:blue;
}
Out put:
heading tag
first paragraph
second paragraph
<html>
<head>
<style type=”text/css”>
</style>
</head>
<body>
<h2> 22/02/2023</h2>
</body>
</html>
Out put:
Out put:
greater of 11,12is =12
</body>
</html>
Out put:
JavaScript Alert
B. Conform Box:
<html>
<head>
<title>demo on confirm box</title>
</head>
<body>
<script type="text/javascript">
var r=confirm("press a button")
if(r==true)
document.write("<h1>you pressed ok!</h1>");
else
document.write("<h1>you pressed cancel!</h1>");
</script>
</body>
</html>
Out put:
</head>
<body >
<script type="text/javascript">
var n=parseInt(prompt("enter a number",10));
document.write( "<br>the given number=" +n);
var r;
var rev=0;
var temp=n;
while (n>0) {
r=n%10;
rev=rev*10+r;
n=Math.floor(n/10);
}
if(temp==rev)
document.write( "<br>the given number is polindrome");
else
document.write( "<br>the given number is not polindrome");
</script>
</body>
</html>
Out put:
</head>
<body >
<script type="text/javascript"> decimal to
var n=parseInt(prompt("enter a number",10));
document.write( "<br>decimal number=" +n);
var r;
var bn="";
do{
r=n%2;
bn=bn+r;
n=Math.floor(n/2);
}
while (n>0);
document.write("<br>binary number=")
var i=bn.length-1;
while(i>=0){
document.write(bn.substr(i,1));
i=i-1;
}
</script>
</body>
</html>
Out put :
decimal number=10
binary number=1010
C. for loop in the following format
1
12
123
1234
<html>
<head>
<title>demoon nested for</title>
</head>
<body >
<script type="text/javascript">
var i,j;
for(i=1;i<=4;i++)
{
var k=1;
for(j=1;j<=i;j++){
document.write(k+"   ");
k=k+1;
}
document.write("<br>");
}
</script>
</body>
</html>
Out put:
1
1 2
1 2 3
1 2 3 4
}
var c=add();
document.write("sum="+c+"<br>");
document.write("sum="+add()+"<br>");
</script>
</body>
</html>
Out put :
sum=30
sum=30
D. function with return value with arguments:
<html>
<head>
<title>
demo on function with return value with arguments
</title>
</head>
<body>
<script type="text/javascript">
function add(a,b)
{
return(a+b);
}
var x=parseInt(prompt("enter 1st number"));
var y=parseInt(prompt("enter 2nd number"));
document.write("sum="+add(x,y)+"<br>");
</script>
</body>
</html>
sum=90
Out put:
sum=90
9Q: Write a sample php program to print values of variables using HTML?
<HTML>
<head>
</head>
<body>
<?PHP
$sname="Raju";
$class="MCA";
$rollno=23;
?>
</html>
10: Write a php script to calculate and display a simple catalog of fruits shop?
<?PHP
$prod1="apple";
$prod2="banana";
$prod1_price=20;
$prod2_price=30;
$prod1_qty=10;
$prod2_qty=20;
$prod1_total=$prod1_price*$prod1_qty;
$prod2_total=$prod2_price*$prod2_qty;
$grand_total=$prod1_total+$prod2_total;
$discount=$grand_total*0.02;
$net_amount=$grand_total-$discount;
?>
<h1> Sahadev Fruits...</h1>
<table border=2>
<tr>
<td>SNO</td>
<td>Product</td>
<td>Price</td>
<td>Quantity</td>
<td>Total</td>
</tr>
<tr>
<td>01</td>
</tr>
<tr>
<td>02</td>
<td><?PHP echo $prod2; ?></td>
</tr>
</table>
<?PHP
echo "Discount=".$discount;
echo "<br>";
echo "Net Bill=".$net_amount;
?>