Extremely sensitive sensor for melamine used a kind of molecularly mprinted nano-porous film, which displays an excellent and highly selective sorption to melamine in the 3-dimensional porous nanomaterial. The interaction between the porous film and melamine also was studied by using hexacyanoferrate (III) as an electrochemical indicator.