<body>
<?php
function md($m=NULL,$d=NULL,$y=NULL)
{
$months=array(1=>'January','February','March','April','May','June','July','Augst','September','October','November','December');
echo '<select>';
foreach($months as $key=>$value)
{
echo "<option value=\"$key\"";
if($key==$m){echo 'selected="selected"';}
echo ">$value</option>\n";
}
echo '</select>';
echo '<select>';
for($day=1;$day<=31;$day++)
{
echo "<option value=\"$day\"";
if($day==$d)
{
echo 'selected="selected"';
}
echo ">$day</option>\n";
}
echo '</select>';
echo '<select>';
for($year=2001;$year<=2015;$year++)
{
echo "<option value=\"$year\"";
if($year==$y)
{
echo 'selected="selected"';
}
echo ">$year</option>\n";
}
echo '</select>';
}
echo '<h1>select a date:</h1><p><br/><p><form method="post">';
$dates=getdate();
md($dates['mon'],$dates['mday'],$dates['year']);
echo '</form></p><br/></p>';
echo '<p>Today is'.date('l').'. The current time is'.date('H:i a').'.</p>';
?>
</body>
PHP动态创建Web站点的方法
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.heiqu.com/df55ce65d452f5ba11d8efa75480ae8e.html