kbs writen by c and php