im trying to set up a calendar using the code from the following site, however i have only got up to the code displayed below, which the site says it should show a calendar however im getting this error. I do however want to set up the whole calendar to use it with events and a flat-file database, so if anyone can maybe check out the site and tell me why it isnt working i'd appreciate it.
Btw its supposed to have the source code to download, but if you read the comments you will learn that its not there.
Parse error: syntax error, unexpected $end in /home2/lifeimpr/public_html/allegro/calendar/cal.php on line 58
The site: http://www.devarticles.com/c/a/PHP/A-Useful-Event-Calendar-Written-In-PHP/2/
<?php
// Get values from query string
$day = $_GET["day"];
$month = $_GET["month"];
$year = $_GET["year"];
$sel = $_GET["sel"];
$what = $_GET["what"];
if($day == "")
$day = date("j");
if($month == "")
$month = date("m");
if($year == "")
$year = date("Y");
$currentTimeStamp = strtotime("$year-$month-$day");
$monthName = date("F", $currentTimeStamp);
$numDays = date("t", $currentTimeStamp);
$counter = 0;
$numEventsThisMonth = 0;
$hasEvent = false;
$todaysEvents = "";
?>
<table width='350' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td class='head' width='50'>S</td>
<td class='head' width='50'>M</td>
<td class='head' width='50'>T</td>
<td class='head' width='50'>W</td>
<td class='head' width='50'>T</td>
<td class='head' width='50'>F</td>
<td class='head' width='50'>S</td>
</tr>
<?php
$numDays = date("t", $currentTimeStamp);
for($i = 1; $i < $numDays+1; $i++, $counter++)
{
$timeStamp = strtotime("$year-$month-$i");
if($i == 1)
{
// Workout when the first day of the month is
$firstDay = date("w", $timeStamp);
for($j = 0; $j < $firstDay; $j++, $counter++)
echo "<td> </td>";
}
if($counter % 7 == 0)
echo "</tr><tr>";
echo "<td width='50'>$I</td>";
?>