[Snippet] Simple Valid HTML Calendar

http://www.acecoolco.com/tutorials/28/simple-calendar-that-is-valid-html-4.01-transitional/page_1/tutorial_17.html

Copy and paste the code into a blank php file and enjoy :slight_smile:
{
$cal_weeks_days .= ‘

’;
$ii = 1;
}
// If the day is the current day, highlight it with a special color
$extra = ($current_day == $day_i) ? 'background-color: ' . $row_highlight_color . ';': 'background-color: ' . $color . ';';

// Show the days.
$cal_weeks_days .= '<td valign="top"  style="' . $extra . ' height: 65px;">' . $day_i . '</td>';

// Increment the day number and the week day number (ii)
$day_i++;
$ii++;

}

// Add end month spacers
if ((8 - $ii) >= 1)
{
$cal_weeks_days .= ’

 ';
}

// Echo the VALID HTML
echo <<< HTML

  <html>
<head>
    <title>Valid HTML Simple Calendar by Acecoolco</title>
    <style type="text/css">
    table,tr,td,th,tbody,TR,TD{
        font-family: Verdana;
        font-size: 8pt;
        font-size: 11; color: #000000;
        border-font-size: 11; color: #000000;
        border-collapse: collapse;
    }
    </style>
    </head>
<body>
    <table border="1" cellpadding="1" cellspacing="1" width="$calendar_width">
        <tr>
            <td align="center" colspan="7" bgcolor="$row_head_color">$current_day_name the $current_day_S of $current_month_name, $current_year</td>
        </tr>
        <tr>
            $day_names
        </tr>
        <tr>
            $cal_weeks_days
        </tr>
    </table>
</body>
HTML; ?> [/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service