We introduce a supervised learning algorithm for photonic spiking neural network (SNN) based on back propagation. For the supervised learning algorithm, the information is encoded into spike trains with different strength, and the SNN is trained according to different patterns composed of different spike numbers of the output neurons. Furthermore, the classification task is performed numerically and experimentally based on the supervised learning algorithm in the SNN. The SNN is composed of photonic spiking neuron based on vertical-cavity surface-emitting laser which is functionally similar to leaky-integrate and fire neuron. The results prove the demonstration of the algorithm implementation on hardware. To seek ultra-low power consumption and ultra-low delay, it is great significance to design and implement a hardware-friendly learning algorithm of photonic neural networks and realize hardware-algorithm collaborative computing.