if else to check posted variables : _POST « Form « PHP






if else to check posted variables

 
<?php
     $secretNumber = 453;
     if ($_POST['guess'] == $secretNumber) {
          echo "<p>Congratulations!!</p>";  
     } else {
          echo "<p>Sorry!</p>";
     }
?>
  
  








Related examples in the same category

1.Basic PHP form processing
2.Changing a value in $_POST
3.Verifying a required element
4.Superglobals vs. Globals
5.Testing a required field
6.Set Cookie Data