$date = date("h:i:s"); if( $date == "23:59:59"){ header("location: alma.fa"); }else{ //source of index }