...
Это все потому, что при посте ты из формы передаешь только переменную $guess. Измени фунцию printForm на эту:
function printForm(){
global $numPetals;
print <<<HERE
<h3>How many petals around the rose?</h3>
<form method = "post">
<input type = "text"
name = "guess"
value = "">
<br>
<input type="hidden" value="$numPetals" name="numPetals" /> <!-- передаем прав. число -->
<input type = "submit">
</form>
<br>
<a href = "petalHelp.html"
target = "helpPage">
give me a hint</a>
HERE;
} // end for printForm
и все заработает. Обрати внимание на строчку
<input type="hidden" value="$numPetals" name="numPetals" />
Вот здесь ты передаешь сгенеренный $numPetals.
Edited by Ilg, 25 February 2008 - 08:45 PM.