communication
 databases
 directories
 file handling
 html and code
 image editing
 image listing
 sessions and co
 string handling
 information
 forms
 apple stuff
 image handling
 array handling
 lixlpixel
php - snippets
google search terms detected and highlighted.
remove highlighting | keep highlighting
make snippet in "forms" - download "datepicker" - open demo of "datepicker"
 search
php - snippets

Valid CSS!

php webring logo
prev next
random list
join the Ring!

forms - datepicker was created/last modified on Wed 17 Mar 2004 6:37 AM

this will generate a form to choose a date
  
<?

  
echo "<H4>Date Picker</H4>\n";
  
$Year = date("Y");

  
//Create the form
  
echo "<FORM ACTION=".$_SERVER['PHP_SELF']." METHOD=POST>";

  
//Create the month pull-down menu
  
echo "Select a month:<BR>\n";
  echo
"<SELECT NAME=Month><OPTION>Choose One</OPTION>\n";
  echo
"<OPTION VALUE=January>January</OPTION>\n";
  echo
"<OPTION VALUE=February>February</OPTION>\n";
  echo
"<OPTION VALUE=March>March</OPTION>\n";
  echo
"<OPTION VALUE=April>April</OPTION>\n";
  echo
"<OPTION VALUE=May>May</OPTION>\n";
  echo
"<OPTION VALUE=June>June</OPTION>\n";
  echo
"<OPTION VALUE=July>July</OPTION>\n";
  echo
"<OPTION VALUE=August>August</OPTION>\n";
  echo
"<OPTION VALUE=September>September</OPTION>\n";
  echo
"<OPTION VALUE=October>October</OPTION>\n";
  echo
"<OPTION VALUE=November>November</OPTION>\n";
  echo
"<OPTION VALUE=December>December</OPTION>\n";
  echo
"</SELECT>\n";

  
//Create the day pull-down menu.
  
echo "<P>Select a day:<BR>\n";
  echo
"<SELECT NAME=Day><OPTION>Choose One</OPTION>\n";
  
$Day = 1;
  while (
$Day <= 31) {
    echo
"<OPTION VALUE=$Day>$Day</OPTION>\n";
    
$Day++;
  }
  echo
"</SELECT>\n";

  
//Create the year pull-down menu.
  
echo "<P>Select a year:<BR>\n";
  echo
"<SELECT NAME=Year><OPTION>Choose One</OPTION>\n";
  
$EndYear = $Year + 10;
  while (
$Year <= $EndYear) {
    echo
"<OPTION VALUE=$Year>$Year</OPTION>\n";
    
$Year++;
  }
  echo
"</SELECT>\n";
  echo
"<P>";
  echo
"<INPUT TYPE='SUBMIT' NAME='Submit' VALUE='Submit'>";
  echo
"<INPUT TYPE='RESET' VALUE='Start Over'>";
  
?>

learn more about some of the PHP functions used in this snippet: date, echo, for, while

view the GNU general license - view the GNU library license - search on PHPsnippets - see your code like this

 a lixlpixel.com site

PHParadise.com - PHP-classes.org - your site on safari