How Do I Calculate The Area of Rectangle Using PHP

admin_img Posted By Bajarangi soft , Posted On 27-11-2020

In PHP we can calculate Area of a rectangle by using formula Length ∗ Breadth = Area .So today we discuss how to calculate it.

How Do I Calculate The Area of Rectangle Using PHP

Complete Code For Calculate The Area of Rectangle Using PHP.

<!DOCTYPE html>
<html>
<head>
    <title>How Can I Calculate The Area of Triangle Using PHP</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    body {
        background: black;
    }
</style>
<body>
<body>
<div class="container">
    <br/><br/>
    <div class="text-center">
        <h1 id="color" style="color: white;">Calculating The Area of Triangle Using PHP</h1>
    </div>

    <div class="well">
        <form action="" method="post" >
            <label>Enter Width</label><br>
            <input type="text" name="width"  value=""><br><br>
            <label>Enter Length</label><br>
            <input type="text" name="length" value=""><br><br>
            <input type="submit" value="submit" class="btn btn-success" name="submit">
        </form>

        <?php
        if(isset($_POST['submit']))
        {
            $width = $_POST['width'];
            $length = $_POST['length'];
            $area = $width*$length;
            echo "The area of a rectangle with $width x $length is $area";
        }
        ?>
    </div>
</div>
</body>
</html>

Related Post