Hi John,
All the stuff with the tags and error reporting is already there.
If you look at the original code the month displays the way that I want. It shows month, followed by the values. The array includes the word ‘Month’ and does not include a range. If I rewrote the arrays to include the words ‘Day’ and ‘Year’ and all the values in the range, it would work fine.
Following is the code that “works” but it is ugly as the arrays don’t have ranges and all the values are spelled out.
<div>
<h2>Register</h2>
<form action=“pursue_form.php” method=“post”>
<fieldset><legend>Your Information: </legend>
<p><label>First Name: <br><input type="text" name="name" size="30" maxlength="40" /></label></p>
<p><label>Last Name: <br><input type="text" name="name" size="30" maxlength="40" /></label></p>
<p><label>Email Address: <br><input type="text" name="email" size="30" maxlength="60" /></label></p>
<p><label>User Name: <br><input type="text" name="email" size="30" maxlength="60" /></label></p>
<p><label>Password: <br><input type="text" name="email" size="30" maxlength="60" /></label></p>
<p><label>Repeat Password: <br><input type="text" name="email" size="30" maxlength="60" /></label></p>
</fieldset>
<div id="labelseparator">
<fieldset><legend>Deceased Persons Information</legend>
<p><label>First Name: <br><input type="text" name="name" size="30" maxlength="40" /></label></p>
<p><label>Last Name: <br><input type="text" name="name" size="30" maxlength="40" /></label></p>
<?PHP
// Months Array
$months = array (1 => 'Month', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
// Day and Year Arrays
$days = array('Day ', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
$years = array('Year', 1900, 1901, 1902, 1903, 1904, 1905, 1907, 1908, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972,
1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020);
// Label for date of death
echo "<p><label>Date of Death</label></p>";
// Make the months pull-down menu:
echo '<select name="month">';
foreach ($months as $key => $value) {
echo "<option value=\\"$key\\">$value</option>\
";
}
echo ‘</select>’;
// Make the days pull-down menu:
echo '<select name="day">';
foreach ($days as $value) {
echo "<option value=\\"$value\\">$value</option>\
";
}
echo ‘</select>’;
// Make the years pull-down menu:
echo ‘<select name=“year”>’;
foreach ($years as $value) {
echo “<option value=\”$value\">$value</option>
";
}
echo ‘</select>’;
?>
</fieldset>
</div>
<p align="center"><input type="submit" name="submit" value="Submit My Information" /></p>
</form>
</div>
Of course, I would greatly prefer to use the range as part of the array instead of having to spell out all the numbers / years. This seems simple enough, but I am struggling.
BTW - this is not yet styled much and obviously has no validation. That is the next step after resolving the issue of how it displays.