thanks a lot.... but now, i still have problem with the calendar.... the popup problem have been settled...but another problem arise... the date which is the same date for other month which have events doesn't print out in the calendar... the code is like below [code] $i = 0; foreach($weeks as $week){ echo "<tr>\n"; foreach($week as $d){ if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){ $date = "$year-$month-$d"; if (in_array($d,$dateArray)) { for ($f =0; $f < $num3; $f++) { $date_in_db = mysql_result($Result3,$f,"blogDate"); if ($date == $date_in _db) { echo "<td class=\"linkedDay\" align=\"center\" > <a target=\"popup\" onclick=\"var aWin=window.open ('','popup','width=200,height=200,top=350,left=400,resizeable=no,scrollbars=no'); aWin.focus();\"href=\"blog2.php?date=$date\">$d</a></td>\n"; } } } else if($date == date("Y-m-d")){ echo "<td class=\"today\" align=\"center\" >$d</td>\n"; } else { echo "<td class=\"days\" align=\"center\" >$d</td>\n"; } [/code] The date in the db... 11/07/2006 - events 25/07/2006 - events 30/08/2006 - events