Hi ...I'm new to PHP.. I need some help to debub the below code. Actually I downloaded it my net and Here is my edited calender source code...
Calender.php
<?php
// Get values from query string
$day = isset($_GET['day'])?$_GET['day']:0; //0 is the default?
$month = isset($_GET['month'])?$_GET['month']:0;//0 is the default?
$year = isset($_GET['year'])?$_GET['year']:0;//0 is the default?
//if (isset($_GET["day"])) $day = $_GET["day"];
//if (isset($_GET["month"])) $month = $_GET["month"];
//if (isset($_GET["year"])) $year = $_GET["year"];
if (isset($_GET["sel"])) $sel = $_GET["sel"];
if (isset($_GET["what"])) $what = $_GET["what"];
if (isset($_GET["field"])) $field = $_GET["field"];
if (isset($_GET["form"])) $form = $_GET["form"];
function goNextMonth(month,year,form,field)
{
// If the month is December, increment the year.
if(month == 12)
{
++year;
month = 0;
}
document.location.href = 'calendar.php?month='+(month+1)+'&year='+year+'&form='+form+'&field='+field;
}
function sendToForm(val,field,form)
{
// Send back the date value to the form caller.
eval("opener.document." + form + "." + field + ".value='" + val + "'");
window.close();
}
</script>
</head>
<body style="margin:0px 0px 0px 0px" class="body">
<table width='175' border='0' cellspacing='0' cellpadding='0' class="body">
<tr>
<td width='25' colspan='1'>
<input type='button' class='button' value=' < ' onClick='<?php echo "goLastMonth($month,$year,\"$form\",\"$field\")"; ?>'>
</td>
<td width='125' align="center" colspan='5'>
<span class='title'><?php echo $monthName . " " . $year; ?></span><br>
</td>
<td width='25' colspan='1' align='right'>
<input type='button' class='button' value=' > ' onClick='<?php echo "goNextMonth($month,$year,\"$form\",\"$field\")"; ?>'>
</td>
</tr>
<tr>
<td class='head' align="center" width='25'>S</td>
<td class='head' align="center" width='25'>M</td>
<td class='head' align="center" width='25'>T</td>
<td class='head' align="center" width='25'>W</td>
<td class='head' align="center" width='25'>T</td>
<td class='head' align="center" width='25'>F</td>
<td class='head' align="center" width='25'>S</td>
</tr>
<tr>
<?php
for($i = 1; $i < $numDays+1; $i++, $counter++)
{
$timeStamp = strtotime("$year-$month-$i");
if($i == 1)
{
// Workout when the first day of the month is
$firstDay = date("w", $timeStamp);
Bookmarks