Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>PHP</title>
- </head>
- <body>
- <form action="" method="POST">
- <input type="number" name="x">
- <input type="number" name="y">
- <input type="number" name="z">
- <input type="submit" value="oblicz">
- </form>
- <h1>Tworzymy stronę z zastosowaniem PHP</h1>
- <?php
- $x=$_POST['x'];
- $y=$_POST['y'];
- $z=$_POST['z'];
- if(isset($_POST['x']) && isset($_POST['y']) && isset($_POST['z']))
- {
- try
- {
- if($x+2>=0 && ($x+$y)!=0 && (4+$z/$x+$y) > 0)
- {
- $k=sqrt($x + 2)/($y-3) + 2*(sqrt((4+$z)/($x+$y)));
- echo($k);
- }
- else
- {
- echo("sprawdź poprawność danych");
- }
- }
- catch(Exception $e)
- {
- echo("sprawdź poprawność danych");
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement