Calendar
Posted: Wed Jul 26, 2006 8:59 pm
Jcart | Please use
I want the display to look like this listed below.
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm trying to create a calendar with the format listed below but I prefer to have everything in a loop and can not seem to get the code to display correctly. I trying to do one thing at a time with just display the year and months first before I display the dates. Any suggestion?
calendar.phpCode: Select all
<?php
$nmon = $_REQUEST["nmon"]; // pull number of days of the month from sever
$nyear = $_REQUEST["nyear"]; // pull current year
// set number of days in the given month
$ndays = date("t", mktime(0,0,0,$nmon,1,$nyear));
// set Textual representation of a month
$tmon = date("F", mktime(0,0,0,$nmon,1,$nyear));
// this will display my 1-31 days
for ($x=1; $x<=$ndays;$x++)
{
$myday = date("l", mktime(0,0,0,$nmon,$x,$nyear));
echo "<tr valign='top'>\n";
echo "<td align='left'><font size='2' face='verdana, arial, sans-serif'><b>$myday $tmon $x, $nyear</b></font></td>\n";
echo "</tr>\n";
echo "<tr valign='top'>\n";
echo "<td align='left'><font size='2' face='verdana, arial, sans-serif'>I am testing</font></td>\n";
echo "</tr>\n";
}Code: Select all
2006 2007
Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]