486974 Posted February 4, 2008 Share Posted February 4, 2008 I have copied a tutorial for making a calendar but i keep getting an error message on line 39 i have checked that i have copied it correctly can someone help please <?php $date =time (); $day = date('d', $date); $month = date('m', $date); $year = date('y', $date); $first_day = mktime(0,0,0,$month, 1, $year); $title = date('F', $first_day); $days_of_week = date ('D', $first_day); switch($day_of_week){ case "Sun": $blank = 0; break; case "Mon": $blank = 1; break; case "Tue": $blank = 2; break; case "Wed": $blank = 3; break; case "Thu": $blank = 4; break; case "Fri": $blank = 5; break; case "Sat": $blank = 6; break; } $days_in_month = cal_days_in_month(0, $month, $year); echo "<table border=6 width=394>"; echo "<tr><th colspan=60> $title $year </th></tr>"; echo "<tr><td width=62>S</td><td width=62>M</td><td width=62>T</td> $day_count = 1; echo "<tr>"; while ( $blank > 0 ) { echo "<td></td>"; $blank = $blank-1; $day_count++; } $day_num = 1; while ( $day_num ,= $days_in_month ) { echo "<td> $day_num </td>"; $day_num++; $day_count++; if ($day_count > 7) { echo "</tr><tr>"; $day_count = 1; } } while ( $day_count >1 && $day_count <=7 ) { echo "<td> </td>"; $day_count++; } echo "</tr></table>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/89353-calendar-help/ Share on other sites More sharing options...
haku Posted February 4, 2008 Share Posted February 4, 2008 I don't know where line 39 is, but you have an extra comma here: ( $day_num ,= $days_in_month ) Quote Link to comment https://forums.phpfreaks.com/topic/89353-calendar-help/#findComment-457555 Share on other sites More sharing options...
486974 Posted February 4, 2008 Author Share Posted February 4, 2008 just got rid of comma still not working line 39 is echo "<tr>"; Quote Link to comment https://forums.phpfreaks.com/topic/89353-calendar-help/#findComment-457569 Share on other sites More sharing options...
Aureole Posted February 4, 2008 Share Posted February 4, 2008 There is nothing wrong with the line you speak of. ??? Quote Link to comment https://forums.phpfreaks.com/topic/89353-calendar-help/#findComment-457573 Share on other sites More sharing options...
haku Posted February 4, 2008 Share Posted February 4, 2008 There never is. Its almost always a previous row. As it is in this case. echo "<tr><td width=62>S</td><td width=62>M</td><td width=62>T</td> Missing a double quote. This section of the forum isn't for modifying 3rd party scripts. These aren't even modifications though, they are just syntax errors. Quote Link to comment https://forums.phpfreaks.com/topic/89353-calendar-help/#findComment-457574 Share on other sites More sharing options...
revraz Posted February 4, 2008 Share Posted February 4, 2008 Missing quote and semi colon on that line Quote Link to comment https://forums.phpfreaks.com/topic/89353-calendar-help/#findComment-457640 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.