nazim  mahied

nazim mahied

  • NA
  • 12
  • 7.1k

why it consists errors even though it's correct

Nov 3 2013 12:49 AM
<?php
$num1=$_POST['num1'];
$num2=$_POST['num2'];
$func=$_POST['func'];
$submit=$_POST['submit'];

if(submit == false ){
include ('cool.php');
}
else if ($func == add){
include ('cool.php');
$num3=$num1+$num2;
echo"<b><b>";
echo"<b>solution</b>:";
echo"<b>";
echo"$num1+$num2=$num3";
}else if ($func == sub)
{
include ('cool.php');
$num3=$num1-$num2;
echo"<b><b>";
echo"<b>solution</b>:";
echo"<b>";
echo"$num1-$num2=$num3";
}else if ($func == mul)
{
include ('cool.php');
$num3=$num1*$num2;
echo"<b><b>";
echo"<b>solution</b>:";
echo"<b>";
echo"$num1 x/*$num2=$num3";
}else if ($func == div)
{
include ('cool.php');
$num3=$num1/$num2;
echo"<b><b>";
echo"<b>solution</b>:";
echo"<b>";
echo"$num1/$num2=$num3";
};
?>
the output has errors even though I'm sure it's correct plz help me out 
the errors 
Notice: Use of undefined constant submit - assumed 'submit' in C:\wamp\www\the test\verb.php on line 7
Call Stack
#TimeMemoryFunctionLocation
10.0380147384{main}( )..\verb.php:0

( ! ) Notice: Use of undefined constant add - assumed 'add' in C:\wamp\www\the test\verb.php on line 10
Call Stack
#TimeMemoryFunctionLocation
10.0380147384{main}( )..\verb.php:0