Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>WWW-ohjelmointi H1.1</title>
  4. </head>
  5. <body>
  6. <?php // WWW-ohjelmointi H1.1, kevät 2017, Valtteri Ylisalo.
  7. $toiminto = $_GET['toiminto'];
  8. $arvo = $_GET['arvo'];
  9. if ($toiminto == "lue") {
  10. echo "Arvo on $arvo";
  11. }
  12. else if ($toiminto == "reverse") {
  13. echo "Reverse arvo on " . strrev ($arvo);
  14. }
  15. else if ($toiminto == "kerro") {
  16. if (is_numeric($arvo)) {
  17. $kerrottuna_piilla = $arvo * pi();
  18. echo "Arvo kerrottuna piilla on $kerrottuna_piilla";
  19. }
  20. else {
  21. echo "Arvoa ei voi kertoa, koska se ei ole numeerinen!";
  22. }
  23. }
  24. else {
  25. echo "Antamaasi toimintoa ei ole maaritelty!";
  26. }
  27. ?>
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement