Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1.  
  2. <html>
  3. <body background = "conan.jpg">
  4. <center>
  5. <br><br>
  6. <form method='POST' action='AreaApp.php'>
  7. <h3><font color = "#248dd6">Welcome! Finding the Area </font></h3>
  8. <table border = 5 CELLPADDING='12' CELLSPACING='5' BORDERCOLOR='#248dd6'>
  9. <tr><td>Enter Length:</td><td><input type ="text" name="ln" value =""></td></tr>
  10. <tr><td>Enter Width:</td><td><input type ="text" name="wd" value=" "></td></tr>
  11. <tr><td><input type ="submit" value="Calculate" name="calculate"></td><td><input type ="reset" value="Clear"></td></tr>
  12. </form>
  13. </body>
  14. </html>
  15.  
  16. <?php
  17. //Nino Bert M. Suni BSIT3 Block1
  18. if(isset($_POST["calculate"]))//used to determine if the $_POST["calculate"] is set or in short if the button is clicked.
  19. {
  20.  
  21. $ln = $_POST['ln'];//it retrieves the entered length data from the user.
  22. $wd = $_POST['wd'];//width data.
  23.  
  24. area($ln,$wd);//calls the function area and pass the length and width arguments.
  25.  
  26. }
  27. function area($ln,$wd)//function
  28. {
  29. $area = $ln*$wd;//computation
  30. echo"Length is ".$ln."\n";//displaying result
  31. echo"Width is ".$wd."\n";
  32. echo"Area is ".$area;
  33.  
  34. }
  35.  
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement