Jump to content
Larry Ullman's Book Forums

AlexHe

Members
  • Posts

    2
  • Joined

  • Last visited

AlexHe's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Check my code out: <!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" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Date Menus</title> </head> <body> <?php // Script 10.1 - menus.php /* This script defines and calls a function. */ // This function makes three pull-down menus for the months, days, and years. function make_date_menus($start_year, $end_year = 2012) { // Array to store the months: $months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); // Make the month pull-down menu: print '<select name="month">'; foreach ($months as $key => $value) { print "\n<option value=\"$key\">$value</option>"; } print '</select>'; // Make the day pull-down menu: print '<select name="day">'; for ($day = 1; $day <= 31; $day++) { print "\n<option value=\"$day\">$day</option>"; } print '</select>'; // Make the year pull-down menu: print '<select name="year">'; //$start_year = date('Y'); for ($y = $start_year; $y <= $end_year; $y++) { print "\n<option value=\"$y\">$y</option>"; } print '</select>'; } // End of make_date_menus() function. // Make the form: print '<form action="" method="post">'; make_date_menus(2011, 2050); print '</form>'; ?> </body> </html> OK,this is not a so user-friendly...but that's cool,I think!
  2. Hello,Mr.Ullman I found a small error in your book(4th edition) PAGE:190 "Open layout.html (Script 8.1) in your text editor or IDE, if it isn’t already open." in fact,should be template.html..."layout.html" is in your 3rd edition!I bought that book before. I like your books!
×
×
  • Create New...