2
I’m a beginner in PHP and need a little help.
I am making a very stupid system that performs the sum of two numbers, with this, when the user does not type anything correct and inform him that it needs to be typed two number to calculate the sum, I was able to do this, but it appears a 0 in front of the message, notice:
<?php
error_reporting(0);
if($_POST){
$num1 = $_POST ['campo1'];
$num2 = $_POST ['campo2'];
echo $num1 + $num2;
if($num1 <= 0 && $num2 <= 0) {
echo "Numero invalido!";
}
}
?>
Thank you very much for your young help, I totally understood your logic regarding operators. After inserting on an Else in the correct structure it worked perfectly. Tks a Lot!
– Denilson