How to select data from a drop down list and submit it to a mysql database table?
That is my problem and my question.
I have a php page that creates a drop down menu from a script that auto generates a 14 day cycle date.
I want to choose one of the dates then submit it to a mysql db table.
Im pretty much lost on this issue as it seems its not a normal form submit option.
So do i need to createa form and if so how to do so?
Or is there a different menthod that must be applied and if so what is it and how to do it?
Here is the code from the auto generated drop down script
<code>
$selname="we_date";
//Build Begin date
$month=9;
$day=07;
$year=2007;
$hour=date('H');
$min=date('i');
$sec=date('s');
//convert it to unix timestamp
$bdate=mktime($hour,$min,$
sec,$month
,$day,$yea
r);
//Build Today
$thour=date('H');
$tmin=date('i');
$tsec=date('s');
$tmonth=date('n');
$tday=date('d');
$tyear=date('Y');
//convert it to unix timestamp
$today=mktime($thour,$tmin
,$tsec,$tm
onth,$tday
,$tyear);
//just the weeks
$nbdate=floor($bdate/(7 * 24 * 60 * 60));
$ntoday=floor($today/(7 * 24 * 60 * 60));
//difference between today and the beginning date
$diff=$today-$bdate;
echo "<select size='1' name='$selname'>\n";
// The while statement $today+ value starts with the amount of days you want to include so for a year from now you will say 365 from the begin date.
while ($bdate <= $today+(475 * 24 * 60 * 60)){
echo ("<option value='".date('n/d/Y',$bda
te)."'>
".date('n/d/Y',$bdate)."</
option>\n"
);
// this entry $bdate=$bdate= is ( amount of days * 24 hours * 60 minutes * 60 seconds) so what ever you want the drop down box to show in amount of days difference enter in days
$bdate=$bdate+(14 * 24 * 60 * 60);
}
echo "</select>";
</code>
Start Free Trial