I having problems figuring out what will be passed through a form that I am using with the following code. Basically it will allow me to select the date (ie 04-28-2005) but when I pass dateMO, dateDay, or dateYr I don't get an output on my data which is pumping out to a table. I can't send $n,$n,$n which is dumb...
The form that is executed does this to format the date to hopefully display correctly - like the following:
$todaymo=trim($_POST["dateMO"]);
$todayday=trim($_POST["dateDay"]);
$startyr=trim($_POST["dateYr"]);
$submit_date="$todayyr-$todaymo-$todayday";
So if the data is being pumped through it should be working right? ugh.. any help would be great! Thanks!
<b>Submit Date: </b>";
/* create an array of months*/
//$monthName = array(1=> "January", "February", "March","April", "May", "June", "July","August", "September", "October","November", "December");
$monthName = array(1=> "01", "02", "03","04", "05", "06", "07","08", "09", "10","11", "12");
$today = time(); //stores today’s date
//$f_today = date("Y-m-d",$today); //formats today’s date
/* build selection list for the month */
$todayMO = date("m",$today); //get the month from $today
echo "<select name=’dateMO’>";
for ($n=1;$n<=12;$n++)
{
echo "<option value=$n";
if ($todayMO == $n) echo " selected";
{
echo "> $monthName[$n]";
}
}
echo "</select>";
/* build selection list for the day */
$todayDay= date("d",$today); //get the day from $today
echo "<select name=’dateDay’>";
for ($n=1;$n<=31;$n++)
{
echo " <option value=$n";
if ($todayDay == $n )
{
echo " selected";
}
echo "> $n";
}
echo "</select>";
/* build selection list for the year */
$startYr = date("Y", $today); //get the year from $today
echo "<select name=’dateYr’>";
for ($n=$startYr;$n<=$startYr+3;$n++)
{
echo " <option value=$n";
if ($startYr == $n )
{
echo " selected";
}
echo "> $n";
}
echo "</select>";