I have made this simple php to check if a number is a positive or a negative. It works but I get this notice: Undefined index: submit.
<?php if (!$_POST["submit"]) { ?> <body> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> Enter a number: <input name="number" size="2"> <input type="submit" name="submit" value="Go"> </form> </body> <?php } else { $number = $_POST['number']; if ($number > 0) { echo 'You entered a positive number'; } elseif ($number < 0) { echo 'You entered a negative number'; } else { echo 'You entered 0'; } } ?> Im new at php so if you can and want :)
$_POSTvalues. $_POST will only be populated when your form is submitted.