Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>First Steps Into PHP</title>
- </head>
- <body>
- <form>
- N: <input type="text" name="num1" />
- M: <input type="text" name="num2" />
- <input type="submit" />
- </form>
- <?php
- if (isset($_GET['num1']) && isset($_GET['num2'])) {
- $num1 = intval($_GET['num1']);
- $num2 = intval($_GET['num2']);
- $res = 0;
- if ($num1 > $num2) {
- $res = $num1 / $num2;
- }
- else {
- $res = $num1 * $num2;
- }
- echo $res;
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment