Jump to content

Marie

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Marie

  1. I have a form on one page that submits to another page. There, it checks if the number is divisible by another number. Please check the code, What is missing or wrong? <?php if(isset($_POST['submit'])) { if(is_numeric($_POST['num1']) && is_numeric($_POST['num2'])) { if($_POST['operation'] == 'divided by') { if ($num1 % $num2 == 0) { echo $_POST['num1'] . ' Is Divisible By ' . $_POST['num2']; } else { echo $_POST['num1'] . ' Is Not Divisible By ' . $_POST['num2']; } echo "<h1>{$_POST['num1']} {$_POST['operation']} {$_POST['num2']} equals {$answer}</h1>"; } else { echo 'Numeric values are required'; } } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.