disclosed is a quaternary ammonium phosphate compound having formula and which has an anticorrosive and a biocidal effect to have a capability of preventing corrosion of various metals including corrosive metal substances , e . g . carbon steels , iron casts , stain steels , coppers , tinning steel plates or alumina and an efficient method of preparing the same . in formula , r1 is a straight or a branched alkyl or aryl radical with 1 to 27 carbon atom free of — oh group and may contain hetero - atoms , and both r2 and r3 are methyl groups or r2 and r3 are combined to form a heterocyclic compound with 4 to 6 of carbon atoms containing oxygen and nitrogen .