Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>WWW-ohjelmointi H1.1</title>
- </head>
- <body>
- <?php // WWW-ohjelmointi H1.1, kevät 2017, Valtteri Ylisalo.
- $toiminto = $_GET['toiminto'];
- $arvo = $_GET['arvo'];
- if ($toiminto == "lue") {
- echo "Arvo on $arvo";
- }
- else if ($toiminto == "reverse") {
- echo "Reverse arvo on " . strrev ($arvo);
- }
- else if ($toiminto == "kerro") {
- if (is_numeric($arvo)) {
- $kerrottuna_piilla = $arvo * pi();
- echo "Arvo kerrottuna piilla on $kerrottuna_piilla";
- }
- else {
- echo "Arvoa ei voi kertoa, koska se ei ole numeerinen!";
- }
- }
- else {
- echo "Antamaasi toimintoa ei ole maaritelty!";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement