How much is 0 multiplied by any value? It's 0, right? Then it is explained. Pure mathematics.
How much is 0 divided by any value? Also 0.
Programming follows the mathematical rules.
If you put 1 in $r
something may come out in the multiplication, but it probably is not what you want. In the division it would probably be better to have another value, but it does not seem that changing the operator makes sense in this code. Even it can probably be simplified, so it has been introduced.
If I had a bigger context I could improve more, but it looks better this way:
$r = 0;
for($ranking = 1; $ranking <=5; $ranking++){
$p = isset($_GET["n$ranking"])?$_GET["n$ranking"]:0;
echo "$ranking ° Numero: $p";
$r += $p;
}
I had unnecessary variables there.
If you want to multiply:
$r = 1;
for($ranking = 1; $ranking <=5; $ranking++){
$p = isset($_GET["n$ranking"])?$_GET["n$ranking"]:0;
echo "$ranking ° Numero: $p";
$r *= $p;
}
I did not even mention that this code has serious security problems because it takes a data that comes from outside and trusts that it will be right. But that's another matter.