help me to validate calendar function
Posted: Thu Oct 01, 2009 12:23 am
hello friends
i am having calendar function ....but i dont know how to validate it and how to send its value to data base.....please help me in this
i tried it but not getting
i am having calendar function ....but i dont know how to validate it and how to send its value to data base.....please help me in this
i tried it but not getting
Code: Select all
//This function makes 3 pulldown menus for the months, days, and years.
function make_calendar_pulldowns2($m2 = NULL, $d2 = NULL, $y2 = NULL)
{
//Make the years pull-down menu.
echo '<select name="year2">';
for ($year2 = 1960; $year2 <= 2022;
$year2++)
{
echo "<option value=\"$year2\"";
if ($year2 == $y2)
{
//Preselect.
echo ' selected="selected"';
}
echo ">$year2</option>\n";
}
echo '</select>';
//Make the months array.
$months2 = array (1 => '1','2','3','4','5','6','7','8','9','10','11','12');
//Make the months into a pulldowm.
echo '<select name="month2">';
foreach ($months2 as $key => $value)
{
echo "<option value=\"$key\"";
if ($key == $m2);
{
//Preselect.
echo ' selected="selected"';
}
echo ">$value</option>\n";
}
echo '</select>';
//Make the days pull-down menu.
echo '<select name="day2">';
for ($day2 = 1; $day2 <= 31; $day2++)
{
echo "<option value=\"$day2\"";
if ($day2 == $d2)
{
//Preselect.
echo ' selected="selected"';
}
echo ">$day2</option>\n";
}
echo '</select>';
}//End of Function Definition
//Get today's date and call the function.
$dates2 = getdate();
$date_birth = "make_calendar_pulldowns2";
$date_join = "make_calendar_pulldowns2";
$date_term = "make_calendar_pulldowns2";