<?php
// timelock.php - displays a different page based on countdown
// 24th March 2005 - maxious@lambdacomplex.org
// usage: change $end and the sorry/unlocked.htm pages
// when to unlock a page
$end mktime(0,0,0,3,27,2005);
// what is now in a date format
$todaymktime(date("G"),date("i"),date("s"),date("m"),date("d"),date("Y"));
// if the end isn't past now in epoch
if ( $end time() > 0) {
// include the sorry page
include("sorry.htm");
// calculate how much longer
$days=($end-$today)/86400;
$r1 explode('.',$days);
$hours=24*($days-$r1[0]);
$r2 explode('.',$hours);
$minutes=60*($hours-$r2[0]);
$r3 explode('.',$minutes);
$seconds=60*($minutes-$r3[0]);
$r4 explode('.',$seconds);
// display message
echo '<br>Time left: ' $r1[0] . ' days, ' $r2[0] . ' hours, ' $r3[0] . ' minutes, ' $r4[0] . ' seconds!';
// otherwise its time to open the curtain
} else
{
// the unlocked page
include("unlocked.htm");
}
?>