Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3. To change this license header, choose License Headers in Project Properties.
  4. To change this template file, choose Tools | Templates
  5. and open the template in the editor.
  6. -->
  7. <?php
  8.  
  9. require "Models/quadrado.php";
  10. require "Helpers/req.php";
  11.  
  12. $quadrado = new Quadrado();
  13.  
  14. $quadrado->altura = req::pegar("altura");
  15.  
  16. $quadrado->largura = req::pegar("largura");
  17.  
  18.  
  19. $area = $quadrado->calcular_area();
  20.  
  21. echo $area;
  22. ?>
  23.  
  24.  
  25. <html lang="pt-br">
  26. <head>
  27. <meta charset="UTF-8">
  28. <title>Classes e Objetos</title>
  29. </head>
  30. <body>
  31. <h1>Área do Quadrado</h1>
  32.  
  33. <form method="post">
  34. <label>Altura: </label>
  35. <input type="text" placeholder="Altura" name="altura"/></br>
  36. <label>Largura: </label>
  37. <input type="text" placeholder="Largura" name="largura"/></br>
  38. <input type="submit" value="Calcular Área"/>
  39.  
  40. </form>
  41.  
  42. <h2>A Área do quadrado é <?php echo $area; ?> cm</h2>
  43.  
  44.  
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement