I have a form at ( (feel free to fill it out) where users choose a month, passed on via POST in a variable called outmonth with the values of 01, 02, 03 etc. Everything works fine except for 2 values: 08 and 09 which should be converted to August & September. I'm baffled by this, I've gone thru the form & the script a dozen of times checked to see that the values are sent as they should, but I can't find the problem. Please respond a.s.a.p !!!!!
if ($_POST[outmonth] == 00) {
echo "<br><br><h3>You haven't chosen your travel month, please click the back button, enter a date and click submit again</h3>";
exit; }
//display month name to user instead of just a number
elseif ($_POST[outmonth] == 01) {
$displaydate = "January";
}
else if ($_POST[outmonth] == 02) {
$displaydate = "February";
}
else if ($_POST[outmonth] == 03) {
$displaydate = "March";
}
else if ($_POST[outmonth] == 04) {
$displaydate = "April";
}
else if ($_POST[outmonth] == 05) {
$displaydate = "May";
}
else if ($_POST[outmonth] == 06) {
$displaydate = "June";
}
else if ($_POST[outmonth] == 07) {
$displaydate = "July";
}
else if ($_POST[outmonth] == 08) {
$displaydate = "August";
}
else if ($_POST[outmonth] == 09) {
$displaydate = "September";
}
else if ($_POST[outmonth] == 10) {
$displaydate = "October";
}
else if ($_POST[outmonth] == 11) {
$displaydate = "November";
}
else if ($_POST[outmonth] == 12) {
$displaydate = "December";
}
An idle mind is the Devil's workshop!
if ($_POST[outmonth] == 00) {
echo "<br><br><h3>You haven't chosen your travel month, please click the back button, enter a date and click submit again</h3>";
exit; }
//display month name to user instead of just a number
elseif ($_POST[outmonth] == 01) {
$displaydate = "January";
}
else if ($_POST[outmonth] == 02) {
$displaydate = "February";
}
else if ($_POST[outmonth] == 03) {
$displaydate = "March";
}
else if ($_POST[outmonth] == 04) {
$displaydate = "April";
}
else if ($_POST[outmonth] == 05) {
$displaydate = "May";
}
else if ($_POST[outmonth] == 06) {
$displaydate = "June";
}
else if ($_POST[outmonth] == 07) {
$displaydate = "July";
}
else if ($_POST[outmonth] == 08) {
$displaydate = "August";
}
else if ($_POST[outmonth] == 09) {
$displaydate = "September";
}
else if ($_POST[outmonth] == 10) {
$displaydate = "October";
}
else if ($_POST[outmonth] == 11) {
$displaydate = "November";
}
else if ($_POST[outmonth] == 12) {
$displaydate = "December";
}
An idle mind is the Devil's workshop!