Hello, i'm new here, at work, i've been developing a dynamic calendar. So far i have everything down, except one thing. I'm using alternate views like :month, week, & day. The month view was a breeze, but the week view..... I'm having a hardtime trying to get it to actually few 7 days at a time, and then by clicking on 'previous' or 'next', I would like for it to then display the next/previous week. Here's the basic layout of what i'm working with. I was know that i'm obviously doing something wrong, but I can't quite get my finger on it, i'm still quite new to php btw

I'll take any help I can get. thx. again.
Code: Select all
<table>
<tr>
<td>S</td>
<td>M</td>
<td>T</td>
<td>W</td>
<td>T</td>
<td>F</td>
<td>S</td>
</tr>
<tr>
<?php
$today = date('d'); //for today's date
$days = date('t'); //for how many days are in this month
$wday = date('w'); //for the day number in current week
for ($i=0; $i<=6; $i++) {
if ($today > $days){
$today = 1;
}
echo "<td>";
if ($wday > $i){
echo $today-$wday;
} else {
echo $today++;
}
echo "</td>";
}
?>
</tr>
</table>
(the previous and next buttons were removed temporarily until i could get it to actually display the dates in the right places)