I believe the problem lies here:
$month = date("M");
returns the string "Apr"
This is not what you want to send into the mktime() function...
What you want is:
$month = date("n");
which returns an integer that is suitable for mktime()
Run this script in your browser to prove that it works:
<?php
$month = date("n");
$day = date("j");
$yr = date("Y");
echo "Today:<br />";
echo " Month: " . $month . "<br />";
echo " Day: " . $day . "<br />";
echo " Year: " . $yr . "<br />";
echo "<p />";
$todayUnixTimestamp = mktime(0, 0, 0, $month, $day, $yr);
echo "Today in Unix Epoch<br />";
echo $todayUnixTimestamp;
echo "<p />";
$nextYearUnixTimestamp = mktime(0,0,0, $month, $day, $yr+1);
echo "Next year in Unix Epoch<br />";
echo $nextYearUnixTimestamp;
echo "<p />";
echo "Difference in seconds is " . ($nextYearUnixTimestamp - $todayUnixTimestamp);
echo "<br />";
echo "Number of seconds in a year is " . (60 60 24) 365;
echo "<br />";
echo "Number of seconds in a leap year is " . (60 60 24) 366;
echo "<p />";
echo "Lets see what the UNIX timestamps result in human readable form using strftime()<p />";
echo "Today: " . strftime("%B %d %Y", $todayUnixTimestamp) . "<br />";
echo "Next year: " . strftime("%B %d %Y", $nextYearUnixTimestamp) . "<br />";
?>
Output:
Today:
Month: 4
Day: 11
Year: 2005
Today in Unix Epoch
1113202800
Next year in Unix Epoch
1144738800
Difference in seconds is 31536000
Number of seconds in a year is 31536000
Number of seconds in a leap year is 31622400
Lets see what the UNIX timestamps result in human readable form using strftime()
Today: April 11 2005
Next year: April 11 2006