cann someone help me with this code?
i have this in my member.php
to show the userage in members profile but when i view several profiles they are older than their birthday is
---------------------------
// Set userage !
if ($bbuserinfo[birthday] == '0000-00-00') {
$userage = "N/A";
} else {
if (date("Y")<$bday[0] or $bday[0]<1901 or $bday[0]=='0000') {
$userage = "N/A";
}
}
if ( ($userage!="N/A") ){
if (date("m")>=$bday[1] and date("d")>=$bday[2]) {
$userage=(date("Y")-$bday[0]);
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
} else {
$userage=(date("Y")-$bday[0])+1;
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
}
}
if ( ($userage!="N/A") ){
if (date("m")>=$bday[1] and date("d")<=$bday[2]) {
$userage=(date("Y")-$bday[0]);
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
} else {
$userage=(date("Y")-$bday[0])+1;
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
}
}
if ( ($userage!="N/A") ){
if (date("m")<=$bday[1] and date("d")<$bday[2]) {
$userage=(date("Y")-$bday[0])-1;
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
} else {
$userage=(date("Y")-$bday[0]);
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
}
}
--------------------------------------------
Birthday: 23.09.1982
Age: 20
^^ you see? he is older but its still August right?
anyone who knows how to fix this?