Im trying to get this simple page to do three drop down boxes, the boxes for date and year are fine, but month, the only drop down option you get is "$value" so i would assume that the array is at fault or the way it has been typed in by me.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Calander</title>
</head>
<body>
<form action="calender.php" method="post">
<?php # Calendar.php
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',
'September', 'October', 'November', 'December');
$days = range (1, 31);
$years = range (2008, 2018);
echo '<select name="month">';
foreach ($months as $key => $value) {
echo '<option value=\"$key\">$value </option>\n';
}
echo '</select>';
echo '<select name="day">';
foreach ($days as $value) {
echo "<option value=\"$value\">
$value</option>\n";
}
echo '</select>';
echo '<select name="year">';
foreach ($years as $value) {
echo "<option value=\"$value\">
$value</option>\n";
}
echo '</select>';
?>
</form>
</body>
</html>
hope someone can help.
Surf