Language: PHP Highlight Mode: PHP Last Modified: March 16th, 2009
<?PHPFUNCTION DateSelector($inName,$useDate=0){/* create array so we can name months */$monthName=ARRAY(1=>"January","February","March","April","May","June","July","August","September","October","November","December");/* if date invalid or not supplied, use current time */IF($useDate==0){$useDate=TIME();}/* make month selector */ECHO"<SELECT NAME=".$inName."Month>\n";FOR($currentMonth=1;$currentMonth<=12;$currentMonth++){ECHO"<OPTION VALUE=\"";ECHOINTVAL($currentMonth);ECHO"\"";IF(INTVAL(DATE("m",$useDate))==$currentMonth){ECHO" SELECTED";}ECHO">".$monthName[$currentMonth]."\n";}ECHO"</SELECT>";/* make day selector */ECHO"<SELECT NAME=".$inName."Day>\n";FOR($currentDay=1;$currentDay<=31;$currentDay++){ECHO"<OPTION VALUE=\"$currentDay\"";IF(INTVAL(DATE("d",$useDate))==$currentDay){ECHO" SELECTED";}ECHO">$currentDay\n";}ECHO"</SELECT>";/* make year selector */ECHO"<SELECT NAME=".$inName."Year>\n";$startYear=DATE("Y",$useDate);FOR($currentYear=$startYear-5;$currentYear<=$startYear+5;$currentYear++){ECHO"<OPTION VALUE=\"$currentYear\"";IF(DATE("Y",$useDate)==$currentYear){ECHO" SELECTED";}ECHO">$currentYear\n";}ECHO"</SELECT>";}?>
<HTML>
<BODY>
<FORM>
Choose a Date: <?PHP DateSelector("Sample");?>
</FORM>
</BODY>
</HTML>
SQL University.net courses meet the most demanding needs of the business world for advanced education
in a cost-effective manner. SQL University.net courses are available immediately for IT professionals
and can be taken without disruption of your workplace schedule or processes.
Compared to traditional travel-based training, SQL University.net saves time and valuable corporate
resources, allowing companies to do more with less. That's our mission, and that's what we deliver.