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';
}
}
}
?>