dopiero ucze sie PHP i mam pytanko

Pozdrawiam
<html>
<head>
<title>Formularz sprawdzajacy</title>
</head>
<?php
function have_required($array, $required_fields) {
foreach($required_fields as $field)
{ if(empty($array[$field])) return false;
}
return true;
}
if(isset($_POST['submitted']))
{
echo '<p>';
echo have_required($_POST, array('name','email')) ? 'masz wypelnione wszystkie wymagane pola':'nie masz wypelnionych wszystkich wymaganych pol';
echo '</p>';
}
?>
<form action = "<?= $PHP_SELF ?>" method="POST">
<p>
Imie: <input type="text" name="name"/></br>
Adres email: <input type='text' name="email" /></br>
Wiek (opcjonalny): <input type="text" name="age" /></br>
</p>
<p align="center">
<input type="submit" value="Wyslij" name="submitted" />
</p>
</form>
</html>