Go back to the previous page.
$daymonths=array(0,31,28,31,30,31,30,31,31,30,31,30,31);
$monthnames=array("","Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec");
$yearbegin=1995;
$monthbegin=7;
$daybegin=12;
$now=date("Y n d");
$a=explode(" ",$now);
$yearnow=$a[0];
$monthnow=$a[1];
$daynow=$a[2];
$daygiven="";
$monthgiven="";
$yeargiven="";
if (isset($_REQUEST["day"])) $daygiven=$_REQUEST["day"];
if (isset($_REQUEST["month"])) $monthgiven=$_REQUEST["month"];
if (isset($_REQUEST["year"])) $yeargiven=$_REQUEST["year"];
if (!isset($_REQUEST["day"]) || !isset($_REQUEST["month"]) || !isset($_REQUEST["year"])) {
$day=$daybegin;
$month=$monthbegin;
$year=$yearbegin;
}
// leap-year. did you have your Y2K today?
if ($yeargiven%4==0 && $yeargiven%100!=0 || $yeargiven%400==0)
$daymonths[2]=29;
printf(
"Information avaible from %04d %s %d to %04d %s %d
\n",
$yearbegin,$monthnames[$monthbegin],$daybegin,
$yearnow,$monthnames[$monthnow],$daynow);
if ($daygiven!=0 && $monthgiven!=0 && $yeargiven!=0) {
printf("You have choosen: %d %s %d.
\n",
$yeargiven,$monthnames[$monthgiven],$daygiven);
}
// if nothing is given, only show the years
if ($yeargiven==0 && $monthgiven==0) {
echo "
$Id: daychooser-demo.php,v 1.2 2003/03/15 07:46:31 mavetju Exp $