Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body background = "conan.jpg">
- <center>
- <br><br>
- <form method='POST' action='AreaApp.php'>
- <h3><font color = "#248dd6">Welcome! Finding the Area </font></h3>
- <table border = 5 CELLPADDING='12' CELLSPACING='5' BORDERCOLOR='#248dd6'>
- <tr><td>Enter Length:</td><td><input type ="text" name="ln" value =""></td></tr>
- <tr><td>Enter Width:</td><td><input type ="text" name="wd" value=" "></td></tr>
- <tr><td><input type ="submit" value="Calculate" name="calculate"></td><td><input type ="reset" value="Clear"></td></tr>
- </form>
- </body>
- </html>
- <?php
- //Nino Bert M. Suni BSIT3 Block1
- if(isset($_POST["calculate"]))//used to determine if the $_POST["calculate"] is set or in short if the button is clicked.
- {
- $ln = $_POST['ln'];//it retrieves the entered length data from the user.
- $wd = $_POST['wd'];//width data.
- area($ln,$wd);//calls the function area and pass the length and width arguments.
- }
- function area($ln,$wd)//function
- {
- $area = $ln*$wd;//computation
- echo"Length is ".$ln."\n";//displaying result
- echo"Width is ".$wd."\n";
- echo"Area is ".$area;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement