Force between two protons Yesterday my teacher was teaching about the production of photons, he told that photons are produced when the electron move from a higher energy level to a lower energy level then suddenly a idea struck in my mind that if electrons are responsible for photons and photons are responsible for electromagnetic force then how will the electromagnetic force will come between two individual protons? Is there more ways to generate photons?
 A: Photons are the quantum  elementary particles of the electromagnetic force . In the table there are elementary particles with charge other than electrons so photons can be produced at the basic level by other charged particles too.
One way they are produced is the way you have been taught at present, by changes in the energy level in atoms, which are composed of electrons and a positively charged nucleus.
Another way is by the scattering of charged particles off the field of other charged particles. This classically is described by the production of light from accelerating charged particles. Classical electricity and magnetism can be shown to emerge from the underlying quantum mechanical level.

how will the electromagnetic force will come between two individual protons? Is there more ways to generate photons?

Individual protons are composite charged particles and may generate photons when scattering off each other's electromagnetic field. The Coulomb force between two protons can be shown in quantum field theory to derive from the mathematical existence of virtual photons , but this needs graduate studies in quantum field theory to understand.
A: Electrons can make photons, but they aren't the only particles that can make photons. Any particle with electric charge can emit or absorb photons.
A: Photons are the carrier of the electromagnetic force. So any charged particle exchanges photons with another charged particle to transmit the force. Electrons aren't the only particles that can emit virtual photons , any charged particle can do it.
A: What you are talking about is the concept of virtual particles. The mechanism of virtual particles is highly theoratical and these are particles are not spotted yet. What actually happens between these electrostatic force is Heisenberg uncertanity priciple and momentum of a photon.
$$\Delta E \Delta t \geq \frac{\hbar}{2}$$
This equation tells us about we cannot be certain about energy at any time.(I will not elaborate it, you can watch videos on youtube for clarification). Here In a virtual photon the energy can increase drastically for very short span of time(A lot of energy means a lot of momentum). The photons are emmited in the direction of the other particle(in this case being the proton). Due to law of conservation of Momentum there is a recoil in the proton and hence the protons repel in this case. Something same happens with electrons.
A: electrons are responsible for photons and photons are responsible for electromagnetic force
Subatomic particles that are accelerated emit photons or - in sum - electromagnetic radiation.
how will the electromagnetic force will come between two individual protons? Is there more ways to generate photons? 
With the EM force, it's a little trickier. There is an electrical interaction between separated charges and there is a magnetic interaction between subatomic particles aligned at their magnetic moment. And, mediated by inductive processes, the Lorentz force moves charges; or moving charges create a common magnetic field.
Force between two protons 
Free protons interact through their electric fields. After a forced approach, they move away from each other as soon as the force is no longer active. In atoms, the situation is different. The equilibrium of protons in the nucleus and electrons in the surroundings makes the atom electrically neutral. But for some reason, which we do not understand to the end, there are also neutrons in the nucleus. Without them, the nucleus or atoms do not exist (or only hydrogen, which is the only chemical element without neutrons in the nucleus).
