Well I see, looks like it is because of the way you modify your code. XD You only get 0 or 1 baby from the last two tries because you have this 'breeding chance' settings. Here:
PHP Code:
$bredtemp = rand(0,100);
if($bredtemp <= "50"){
$article_content = "<center> <img src='http://taleofdragons.net/get/".$maleid.".gif'><br> <img src='http://taleofdragons.net/get/".$femaleid.".gif'><br> These two don't seem very interested in each other right now. Try again in a week.";
}
According to this, the $bredtemp generates a number between 0 to 100, but only when this random number is below 50 will breeding actually occur. For this reason you wont get 3 dragons unless the variable $bredtemp gets a random number below 50 everytime. See the logic? Since each time breeding has 50% chance to succeed, it makes perfect sense why you get 1 out of 3 last time, and 2 out of 4 the first time. The script will work normally if you remove the 'breeding chance' code.