We propose a protocol to controlled implement the two-photon controlled phase gate within a network by using interference of polarized photons. The realization of this protocol is appealing due to the fact that the quantum state of light is robust against the decoherence, and photons are ideal carriers for transmitting quantum information over long distances. The proposed setup involves simple linear optical elements and the conventional photon detectors that only distinguish the vacuum and nonvacuum Fock number states. This can greatly simplify the experimental realization of a linear optical quantum computer.