Program 2. Program To Make A Basic HTML
Program 2. Program To Make A Basic HTML
<!DOCTYPE html>
<html>
<head>
<title>Amizone Home Page</title>
<link rel="stylesheet" type="text/css" href="styling/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="styling/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="styling/style.css">
</head>
<body>
<img src="images/logo.jpeg" id="imgl">
<div class="grey">
<div class="container">
<div class="row">
<div class="col-md-5">
<div class="login">
<b><h1 id="h1">Login <a href="" id="a">Staff|Faculty</a></h1>
<p id="p">User Name <input type="text" name="User_Name" required></p>
<p id="p">Password <input type="Password"
name="Password" required></p>
<p id="p" style="color: #852500;">Type the characters in the box below</p>
<img src="images/verify.png" id="imgv"> </br></br>
<input type="text" name="characters" id="inpute"> </br>
<p><a href="" id="a" style="margin-left: 160px;">Get Password?</a></p></b> </br>
<button> Login</button>
</div>
<div class="extensions">
</div>
</div>
<div class="col-md-7">
<div>
<img src="images/ad.jpg" id="imga">
</div>
</div>
</div>
</div>
<footer>
<p>Help: <a href="">[email protected]</a></p>
<p>Copyright © 2011<a href="">Amity University.</a>All rights reserved. Powered by
AKC Data Systems (India) Pvt. Ltd</p>
</footer>
</div>
</body>
</html>
Program 4. Program to make a basic web form.
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
</style>
</head>
<body>
<h3>Contact Form</h3>
<div class="container">
<form action="/action_page.php">
<label for="fname">First Name</label>
<input type="text" id="fname" name="firstname" placeholder="Your name..">
<label for="lname">Last Name</label>
<input type="text" id="lname" name="lastname" placeholder="Your last name..">
<label for="State">State</label>
<select id="country" name="State">
<option value="australia">Rajasthan</option>
<option value="canada">Haryana</option>
<option value="usa">Delhi,NCR</option>
</select>
<label for="subject">Subject</label>
<textarea id="subject" name="subject" placeholder="Write something.."
style="height:200px"></textarea>
<input type="submit" value="Submit">
</form>
</div>
</body>
</html>
Output:
Program 4. Program to add 2
numbers.
<?php
$a=25;
$b=70;
$c=$a+$b;
echo"the input value is: $a,$b
<br/>"; echo"Sum=",$c;
?>
Output:
Program 5. Program take average of 3
numbers.
<?php
$a=28;
$b=20;
$c=12;
$Avg=($a+$b+$c)/3;
Echo"The initial Values are a:$a, b:$b, c:$c
<br/>"; Echo"The average is: $Avg";
?>
Output:
Program 6. Program to take out area of Rectangle, square
and Circle.
<?php
$l=22;
$w=30;
$a=19;
$r=20;
Echo"The Length and Breath of Rectangle is: $l, \r $w
<br/>"; Echo"The Length ofSquare is: $a <br/>";
Echo"The Radius of the circle is: $r <br/><br/>";
$R=$l*$w;
Echo"The Area of Rectangle is= $R <br/>";
$S=$a*$a;
Echo"The Area of Square is= $S <br/>";
$C=3.14*$r*$r;
Echo"The Area of Circle is= $C <br/>";
?>
Output:
Program 7. Program to Calculate Simple Interest and
Average
<?php
$p=12000;
$r=0.4;
$t=6;
$SI=$p*$r*$t;
$A=$p+$SI;
Echo"The Principle amout is: $p <br/>";
Echo"The Rate of Interest is: $r <br/>";
Echo"The Time Period is: $t years
<br/><br/>"; Echo"Simple Interest= $SI
<br/>";
Echo"The Final Amount= $A";
?>
Output:
Program 8. Program to differentiate between echo and
print.
<?php
echo "Hello ATUL
<br/><br/><br/>";
print(“Course:BCA-3rd");
?>
Output:
Program 9. Program to use String
<?php
$str1='The initial value of x is 8';
$str2='Hello World ';
$str3='This is \'ATUL GARG\' creating page using \'PHP\'';
echo "$str1 <br/> $str2 <br/> $str3";
?>
Output:
Program 10. Program to use Functions.
<?php
function add ($A,$B)
{
$sum=$A+$B;
echo"The First number is $A
<br/><br/>"; echo"The Second number
is $B <br/><br/>"; echo "Sum of two
numbers is $sum";
}
add (50,46);
?>
Output:
Program 11. Program to use Function: Value and
Reference.
<?php
function addfive($num)
{
$num+=14;
}
function addsix(&$num)
{
$num+=15;
}
$x=150;
echo"The original value of X is $x
<br/><br/>"; addfive ($x);
echo "Value of X after Call by value is
$x<br/>"; addsix ($x);
echo "Value of X after call by Refrence is $x";
?>
Output: