First error I get says there's a missing comman or semicolon on line 27. Yes, indeed there is a missing semicolon on line 27.
Okay, it parses, it runs, it looks horrible.
"\N" should be "\n"
"&Nbsp" should be " "
"Table Boarder=" should be "Table Border="
"Form Action=" should be "<Form Action="
And there's nothing in the green box. Obviously, the test there is wrong.
Well, $Lastday = "Thu", not (I presume for January) 31. Try using 'd' when defining it instead of 'D'.
Looks good, but the calendar's wrong. It says New Years' was a Sunday. It always thinks months start on Sunday.
Let's see. $Monthstart is initially given the value "W". Why? What should it be? The day of the week the month starts on? isn't that 'w'? Look up date() in the documentation. Yes.
And you're lucky I'm not charging my usual consultancy rate for this. For that matter, you're lucky I'm not grading you on your work.