I am trying to create a calender with a checkbox for each date. When a user clicks the submit button, I want to get those selected dates inserted into the database and those which are not selected would be deleted from the database if those already exist before. I have created a index.php page where I wrote the following code to generate dates:
<form name="form1" method="post" action="show.php">
<?php
$year="2011";
$month="8";
$d=cal_days_in_month(CAL_GREGORIAN,1,2011);
$i=1;
while($i<=$d)
{
?>
<input type="checkbox" name="date[]" value="<? echo " $year-$month- " . $i . ""."<br>"; ?>">
<? echo " $year-$month- " . $i . ""."<br>"; ?>
<?
$i++;
}
?>
<input type="submit" name="Submit" value="Submit">
</form>
And then I created page another page named show.php where I tried to write codes for inserting information, but I failed. Would you please kindly help me to do this? I have tried my best but I couldn't make it happened. Thanks in advance.