
Originally Posted by
skeptic_rob
bro need ur help here na mi registration form nga na ai birthdate nga field then kung present gani cya nga taw then ni fillup cya birthdate nga field na certain nga mo prompt out nga dli pwede kay karon ka nataw then karon sad ka pa register ..
gi in ani man gud na ko pag code
if($birthdate==date("Y-M-D")
{
}
else
{
die('Current date are not allowed");
}
Wala ko kaayo ka gets sa imong pangutana bai pero ang checking sa birthdate kay depende na sa age target nimo. So given sa imong example, more or less naa ka dapat ing.ani nga condition:
Code:
$td = strtotime(date('Y-m-d')); # get the current date
$bd = strtotime($birthdate); # get the birth date
$diff = $td - $bd;
if($diff > 0) {
echo "ok";
} else {
echo "not ok";
}