PHP - Calculate the user's (approximate) age... using an hours-per-day constant?

I need help with this PHP Form Calculation assignment.

Assignment Details

Code a single HTML form (name it asgn_2_yourlastname.htm) and a single PHP page (asgn_2_yourlastname.php) to
create the following Web application:

Write an HTML form that will allow a user to enter their first and last name,
in separate text fields, and the number of hours they sleep each night, and
the year that they were born (entered as four digits).
Also include a submit button.

The Web page body should display “Enter the information and click the submit button”.
The font should be “Arial” (or “Helvetica”) and the text color should be blue.
The background is white.

[COLOR=Red]BEGIN HTML CODE[/COLOR]

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” />
<title>Kistler My 2nd PHP Program My Unconscious Life form</title>
</head>
<body>
<h1><font face=“Arial, Helvetica” color=“blue”>My Unconscious Life</font></h1>

<h3><font face=“Arial, Helvetica” color=“blue”>Enter the information and click the submit button</font></h3>
<br />
<form method=“post” action=“asgn_2_kistler.php”>
<table width=“450” border=“0” cellspacing=“0” cellpadding=“0”>
<tr>
<td><font face=“Arial, Helvetica” color=“blue”>First Name</font></td>
<td><input type=“text” name=“first_name” size=“20” /></td>
</tr>
<tr>
<td><font face=“Arial, Helvetica” color=“blue”>Last Name</font></td>
<td><input type=“text” name=“last_name” size=“20” /></td>
</tr>
<tr>
<td><font face=“Arial, Helvetica” color=“blue”>Number of Hours Slept per Night</font></td>
<td><input type=“text” name=“hours_slept” size=“20” /></td>
</tr>
<tr>
<td><font face=“Arial, Helvetica” color=“blue”>Year you were born (YYYY)</font></td>
<td><input type=“text” name=“birth_year” size=“20” /></td>
</tr>
<tr>
<td rowspan=“2”><input type=“submit” name=“submit” value=“Submit” /></td>
</tr>
</table>
</form>

</body>
</html>

[COLOR=Red]END HTML CODE[/COLOR]

When the user clicks the submit button, call a PHP page that does the following:

Calculate the user’s (approximate) age by subtracting their birth year from
the current year. Use the date() function to retrieve the information in the
proper format. See the chapter on “Managing Date and Time”. Email me if you
need help with this.

Create an hours-per-day constant and use it in your program.

Calculate how many years the user has slept in his or her life. Determine the
Years-Slept by dividing the hours they sleep per night by the hours-per-day constant
you created above, then multiple that quotient by their age.

Concatenate the first and last names into a full_name variable so that
there is a space between the first and last name. For example, if the user
enters ‘Steve’ in the first name field and enters ‘Perry’ in the last name
field, the full_name variable should be set to ‘Steve Perry’.

The heading should read: “My Unconscious Life”
The Web page body should display "Hey [full_name]! You have slept [years_slept] of your life away!
The font should “Arial” (or “Helvetica”) text should be in blue.
The background is white.
Numbers formatted to two decimal places

Use the number_format( ) function. Example…

        $number = 23.45678;
        $newnumber = number_format($number, 2);  //display two decimal places

Now look at the number of years the user has slept in their life and write out
the following message if they have slept 15 or more years…

Wow!  You've slept longer than most dogs live.

Otherwise, display…

    Take a nap.  You've got it coming.

[COLOR=Red]BEGIN PHP CODE[/COLOR]

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” />
<title>Kistler My 2nd PHP Program My Unconscious Life results</title>
</head>
<body>
<?php [COLOR=Orange]// Script - asgn_2_kistler.php[/COLOR]

[COLOR=Orange]/*

COMMENTS LEDGEND

// MY COMMENTS

//Perry MY INSTRUCTORS COMMENTS

*/

// This page receives the data from asgn_2_kistler.html.
// It will recieve: first_name, last_name, hours_slept, and year_born varibles.

// Address error handing.[/COLOR]
ini_set (‘display_errors’, 1); [COLOR=Orange]// Let me learn from my mistakes.[/COLOR]
error_reporting (E_ALL & ~ E_NOTICE); [COLOR=Orange]// Don’t show notices.[/COLOR]

[COLOR=Orange]// In case register_globals is disabled.[/COLOR]
$first_name = $_POST [‘first_name’];
$last_name = $_POST [‘last_name’];
$hours_slept = $_POST [‘hours_slept’];
$birth_year = $_POST [‘birth_year’];

[COLOR=Orange]// Create a name varible.[/COLOR]
$full_name = $first_name .’ '. $last_name;

[COLOR=Orange]// Adjust for Magic Quotes.[/COLOR]
$full_name = stripslashes ($full_name);

[COLOR=Orange]// Get current date.[/COLOR]
$today = date(‘Y’); [COLOR=Orange] //Perry - This is the way to get the year.[/COLOR]

[COLOR=Orange]// Calculate the users (approximate) age by subtracting their (birth year) from the (current year).[/COLOR]
$age = $birth_year - $today; [COLOR=Orange]//Perry - Your calculation is not following the comment above.[/COLOR]

[COLOR=Red]/*

I THINK THIS IS WHERE MY PROBLEM IS
DO I NEED TO CREATE A VARIBLE $hours_per_day CONSTANT?
THEN CALCULATE $years_slept = $hours_slept / $hours_per_day

*/[/COLOR]

[COLOR=Orange]// Calculate how many years the user has slept by dividing the (hours they sleep per night) by the (hours-per-day constant)[/COLOR]
$years_slept = $hours_slept / $today; [COLOR=Orange] //Perry - $today is the year, not the hours[/COLOR]

[COLOR=Orange]// Then multiply that quotient by their age.[/COLOR]
$years_slept = $years_slept * $age; [COLOR=Orange] //Perry - Where is the age?[/COLOR]

[COLOR=Orange]// Apply the proper formatting[/COLOR]
$years_slept = number_format ($years_slept, 2);

[COLOR=Orange]// Print the message & calculate the user’s approximate age.[/COLOR]
echo “<h1><font face=“Arial, Helvetica” color=“blue”>My Unconscious Life</font></h1><br />”;

echo “<p><font face=“Arial, Helvetica” color=“blue”> Hey $full_name! You have slept $years_slept years of your life away!</font></p><br />”;

[COLOR=Orange]// if they have slept 15 or more years… Print Wow! You’ve slept longer than most dogs live.
// Otherwise, display… Print Take a nap. You’ve got it coming.[/COLOR]
if ($years_slept >= 15) {
echo “<p><font face=“Arial, Helvetica” color=“blue”>Wow! You’ve slept longer then most dogs live.</font></p>”;
} else {
echo “<p><font face=“Arial, Helvetica” color=“blue”>Take a nap. You’ve got it coming.</font></p>”;
}

?>
</body>
</html>

[COLOR=Red]END PHP CODE[/COLOR]