The formula is based on comparing dates/times etc
It should calculate
Currente date/time with the dat choosen in a selectbox
Fieldname : Wedstrijddatum
Pls find the script
- Code: Select all
function getTime($time)
{
$arr = explode("-", $time);
$time = mktime(0,0,0,$arr[1], $arr[0], $arr[2]);
return $time;
}
$date1 = getTime($_POST['Wedstrijddatum']);
$date2 = getTime(date("d-m-y"));
if((($date1-$date2))>28*3600*24) {
$ok = false;
$error .= '- U bent te vroeg met inschrijven!.<br />';
}
if((($date1-$date2))<6*3600*24) {
$ok = false;
$error .= '- U bent te laat met inschrijven!.<br />';