The controlled phase gate is one of the most important logic gates in the quantum computation field. In this paper, we proposed a protocol for implementing the two-qubit controlled phase gates with the help of cross-Kerr nonlinearity, optical elements and the conventional photon detectors, which are feasible with existing experimental technology. The protocol also can be applied to implement the controlled phase gates of many different atomic and photonic degrees of freedom with successful probability of 100%, that is, our protocol is efficient and flexible.