Again, working from the tutorail in PHP and MYSQL for dynamic web sites...
I have done my best to copy the following code from the book and still get a blank browser. I have checked and checked and only come here as a last resort (you guys have helped me before and it always comes down to a comma or something like that).
this is all on one script generating a form using php.
Thank you!
<?php
$page_title = 'Calendar Form';
include('./php/header.inc');
function make_calendar_pulldown($this_month= NULL,$today= NULL,$year
= NULL) {
$months = array(1 => 'January','February','March','April','May',
'June','July','August','September','October',
'November','December');
echo '<select name="month">';
foreach($months as $key => $value) {
echo "<option value = \"$key\"";
if ($value == $this_month) {
echo 'selected = "selected"';
}
echo ">$value</option>\n";
}
echo '</select>
<select name= "day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value= \"$day\"";
if($day == $today) {
echo 'selected= "selected"';
}
echo ">$day</option>\n";
}
echo '</select>
<select name= "year">';
if(!isset($year)) {
$year = date('Y');
}
while ($year <= 2010) {
echo "<option value= \"year\">
$year</option>\n";
$year++;
}
echo '</select>';
}
echo '<form action= "dateform.php" method= "post">';
$dates = getdate();
make_calendar_pulldown(dates['month'],dates['mday'],dates['year']);
echo '</form>';
include('./php/footer.inc');
?>