Page 1 of 1

php time

Posted: Mon May 18, 2009 9:01 am
by shaqa
i have this code below, i have setup a script which click every 24 and save ip to mysql for ip time checking,
but im not understanding if this is correct one, if this line : intval(($today-$last)/86400)+1; is for 24h !
please someone check it and if is wrong correct for me

Code: Select all

function checkLastclick($lastclicked){
    $needclicking = 0;
    $last = strtotime($lastclicked);
    $today = strtotime("now");
    $numdays=intval(($today-$last)/86400)+1;
    
    if($numdays>=2){
        $needclicking = 1;
    }
    
    return ($needclicking);
}

Re: php time

Posted: Wed May 20, 2009 4:20 am
by shaqa
please some one check this