You might want to use SWITCH instead of IF.
For example:
<?php
//this line is to test the switch
$attack = rand(1,100);
switch (TRUE)
{
case ($attack > 69 AND $attack <= 100):
$rand = rand(1,2);
$damage = 50;
break;
case ($attack > 30 AND $attack <= 69):
$rand = rand(1,3);
$damage = 30;
break;
case ($attack > 5 AND $attack <= 30):
$rand = rand(1,4);
$damage = 10;
break;
default:
$rand = "miss!";
$damage = 0;
}
//check results
echo "Attack: " . $attack . "<br />";
echo "Rand: " . $rand . "<br />";
echo "Damage: " . $damage . "<br />";
?>
Incidentally, what you said in your description and what was in your code were doing two different things! It was a bit confusing that you mentioned percentages sometimes, but not all times. That could be construed as $damage = 50% of something, rather than $damage = 50.
Also, you said one range should be greater than 69, another range should be less than 69. What happens if the value IS 69? To account for this, I used <= in my code. I based my code on your description, so where variables aren't correctly named, you can adjust.
Oh, and if you're getting confused by your code, indent it! Hopefully you're using a PHP editor! I like to indent for each curly bracket.
Hope this helps!