Re: next,prev link problems
you should let the date() function figure out everything for you instead. unix timestamps are wonderful. it's much more simple, too. example:
PHP Code:
<?php
//get the month. it is held in $_GET['date'] if there is a previous month
$this_month = (isset($_GET['date']) && is_numeric($_GET['date'])) ? $_GET['date'] : mktime(0, 0, 0, date("n"), 1, date("Y"));
//next month = this month + 1
$next_month = mktime(0, 0, 0, date("n", $this_month) + 1, 1, date("Y", $this_month));
//previous month = this month - 1
$prev_month = mktime(0, 0, 0, date("n", $this_month) - 1, 1, date("Y", $this_month));
?>
<a href="./calendar.php?date=<?php echo $prev_month; ?>"><< <?php echo date("F, Y", $prev_month); ?></a> - <strong><?php echo date("F, Y", $this_month); ?></strong> - <a href="./calendar.php?date=<?php echo $next_month; ?>">>> <?php echo date("F, Y", $next_month); ?></a>
see it in action here. you will lose the ability for your users to enter in custom dates via the query string (at least with my version), but you can easily remedy this by not using unix timestamps in the query string and instead only build them for use within the program using mktime().
hope that helps.
Re: next,prev link problems
Code:
66.249.72.138 - - [19/Apr/2007:23:36:21 -0600] "GET /php/calendar.php?date=1143874800 HTTP/1.1" 200 162 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.72.138 - - [20/Apr/2007:01:30:35 -0600] "GET /robots.txt HTTP/1.1" 404 1076 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.72.138 - - [20/Apr/2007:01:30:35 -0600] "GET /php/calendar.php?date=1141196400 HTTP/1.1" 200 167 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.72.138 - - [20/Apr/2007:03:20:28 -0600] "GET /php/calendar.php?date=1138777200 HTTP/1.1" 200 169 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.72.105 - - [20/Apr/2007:06:10:01 -0600] "GET /php/calendar.php?date=1201849200 HTTP/1.1" 200 169 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.72.105 - - [20/Apr/2007:06:35:01 -0600] "GET /php/calendar.php?date=1136098800 HTTP/1.1" 200 172 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
google was indexing my test thing. and it still is. guess I should be adding a nofollow value to links like that from now on @_@. hehe. fixed!