Php To Find Area Of Rectangle


Create Html From
(rectangle.html)

<!DOCTYPE html>
<html>
<body>
<form action="rect.php" method="POST">
Enter length:<input type="number" name="n1"><br>
Enter breadth:<input type="number" name="n2"><br>
<input type="submit" value="submit">
</form>
</body>
</html>




Embed Php File into Form Tag

<?php

$l=$_POST["n1"];
$b=$_POST["n2"];
$rect=$l*$b;
echo "<h1>Area of rectangle is:$rect</h1>";
?>



Comments