Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="hu">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <?php
- @$num=0;
- if(isset($_POST['gomb'])) {
- writeout();
- @$num=$_POST['szam'];
- }
- function writeout(){
- $num = $_POST['szam'];
- $pre="";
- if ($num!=0)
- {
- $pre = ($num>=0) ? "pozitív" : "negativ";
- }
- else
- {$pre ="semleges";}
- print_r($pre);
- }
- ?>
- <form name="form" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
- <input type="number" value="<?php print @$num; ?>" name="szam" id="szam">
- <button type="submit" name="gomb" id="gomb" >Kattints ide</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement