Hello guys!
I hope you don't mind me posting so quick again. I am struggling or better don't seem to have proper idea about what to do here. I want to make a simple birthday reminder. I have got a list of people in my database and I log in using my id. All I want to do is to display a list of person and if they have got a birthday within the next seven days, display a notification.
I have written a simple function to do that but it doesn't work in the way I want and I can see the prob lies mainly with the month. Is there anything else I can do? Any ideas/help or even link to some tutorials will be gratefully appreciated.
Warm Regards
6pandn21
function CalculateAge($BirthDate)
{
list($Year, $Month, $Day) = explode("-", $BirthDate);
$YearDiff = date("Y") - $Year;
$MonthDiff= date("m") -$Month;
$DayDiff = date("d") - $Day;
if ($DayDiff < 8 && $MonthDiff == 0)
{ $message = " ... this persons's birthday is within the week! <br />";}
else
{$message = "There is no birthday's within 7 days";}
return $message;
}