my first post here!!! learning to be a PHP programmer now!!!
I've made 3 date selection SELECT boxes displaying month/day/year but I'm not able to return the previously selected item after POST..
My code
Code: Select all
<?php
echo '
<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June','July', 'August', 'September', 'October', 'November', 'December');
$weekday = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
$days = range (1, 31);
$years = range (2005, 2015);
//**********************************************
echo "Month: <select name='month' id='month'>";
foreach ($months as $value) {
echo '<option value="'.$value.'">'.$value.'</option>\n';
} echo '</select><br />';
echo "Day: <select name='day' id='day'>";
foreach ($days as $value) {
echo '<option value="'.$value.'">'.$value.'</option>\n';
} echo '</select><br />';
echo "Year: <select name='year' id='year'>";
foreach ($years as $value) {
echo '<option value="'.$value.'">'.$value.'</option>\n';
}
echo '</select><input type="submit" /></form>';
echo $_POST['month']."/".$_POST['day']."/".$_POST['year'];
?>Regards.