We propose a special conditional phase gate (CPG) U^(π/2) between the photon and the electron spin confined in a quantum dot (QD) embedded in a microcavity operating in the weak-coupling regime. This CPG U^(π/2) provides an optical method to manipulate the QDs with photon parity. By using it, we present a scheme for implementing a state teleportation between two remote QD cavities and a scheme for constructing a photonic Bell-state analyzer. Furthermore, a multipartite Greenberger–Horne–Zeilinger state analyzer is also proposed. This multipartite entanglement analyzer can also be used as a multipartite entanglement generator. All these schemes are operated in the weak-coupling regime, so the high fidelities and efficiencies can be maintained even in the case of a bad cavity, and the schemes are accessible with current technologies.