Advertisement
cesarcardinale

M3104 Prog web - TD1 - calculator.php

Sep 17th, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2. function start_page($title)
  3. {
  4. echo ' <!DOCTYPE html>
  5.       <html lang="fr">
  6.       <head><title>' . PHP_EOL . $title . '</title></head>
  7.       <body>' . PHP_EOL
  8. ;
  9. };
  10.  
  11. function end_page()
  12. {
  13. echo '</body>
  14.      </html>' . PHP_EOL
  15. ;
  16. };
  17. $operateurs = '*+-/';
  18.  
  19. start_page('Premier pas en PHP');
  20. ?>
  21.  
  22. <form action="calcul.php" method="post">
  23.   <label for="op1">OP1 :</label>
  24.   <input type="text" id="op1" name="op1">
  25.   <input type="submit" value="+" name="action">
  26.   <input type="submit" value="*" name="action">
  27.   <input type="submit" value="-" name="action">
  28.   <input type="submit" value="/" name="action">
  29.   <label for="op2">OP2 :</label>
  30.   <input type="text" id="op2" name="op2">
  31. </form>
  32.  
  33. <?php end_page(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement