I run win xp, apache 1.3 and php 4.3.2. I made a calendar which works fine but the links to next and previous month.
I dont get any errors, it just doesnt work. it looks right in the url as well. eg: month=2&year=2003, when trying to move from january to february.
I think this part is the problem:
<a href="'.$SERVER['PHP_SELF'].'?month=%d&year=%d">%s</a>';
print '"'.$SERVER['PHP_SELF'].'?month=%d&year=%d">%s';
here is some of the code:
[code=php]
<?php
function pc_calendar($month, $year, $opts = '') {
//set default options //
if (! is_array($opts)) {
$opts = array();
}
if (! isset($opts['today_color'])) {
$opts['today_color'] = '#FFFFoo';
}
if (! isset($opts['month_link'])) {
$opts['month_link'] =
//THIS IS WHERE THE PROBLEM IS I BELIEVE
'<a href="'.$_SERVER['PHP_SELF'].'?month=%d&year=%d">%s</a>';
print '"'.$_SERVER['PHP_SELF'].'?month=%d&year=%d">%s';
}
list($this_month,$this_year,$this_day) = split(',',strftime('%m,%y,%d'));
$day_highlight = (($this_month == $month) && ($this_year == $year));
list($prev_month,$prev_year) =
split(',',strftime('%m,%Y',mktime(0,0,0,$month-1,1,$year)));
$prev_month_link = sprintf($opts['month_link'],$prev_month,$prev_year,'<');
list($next_month,$next_year) =
split(',',strftime('%m,%Y',mktime(0,0,0,$month+1,1,$year)));
$next_month_link = sprintf($opts['month_link'],$next_month,$next_year,'>');
?>
<form name="form1" method="post" action="index.php">
<table border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td align="left"><font size="5">
<?php print $prev_month_link ?>
</font></td>
<td colspan="5" align="center"><font size="5">
<?php print strftime('%B %Y',mktime(0,0,0,$month,1,$year)); ?>
</font></td>
<td align="right"><font size="5">
<?php print $next_month_link ?>
</font></td>
</tr>
<?php