If the sprinkler head does not screw on and off and attached directly to the pipe, then the end piece of pipe needs to be replaced, which is also a very simple repair. If pipe is cracked, you will need another person to turn the water on, while you look where the leak is. After you find the leak, turn the water off and locate the pipe. Dig the dirt and expose the pipe. Find the crack or break in it, cut the section of the pipe and take it to the store so you can get the right pipe size. Purchase a section of pipe long enough to replace the broken section of pipe, you will need a few couplings and if pipe is cracked near the end, where the sprinkler head is located, the end piece which is threaded must be replaced and must be the same size of you sprinkler head thread. You will also need PVC cleaner and PVC cement, Box stores like HD or Lowe's sell small a set that contains 2 small bottles of each.
PVC Coupling image:
How to repair PVC pipe.
After PVC pipe is cut, remove any small pieces left on the edges from when you cut the pipe. You can do this with a rag or some sandpaper. Use PVC cleaner that came with the set you purchased, it will be purple color,be sure to use that on both sections of the pipe,i.e. new and old. Next open second bottle which is clear, the bottle also has a brush inside as the other one... Use the brush on both pipes new and old and apply PVC cement about 1 inch on the outside and also inside the coupling, then push the new pipe into the coupling and give it a half of turn. Do the same thing on the end piece on the inside of the screw adapter and push them together. Give a few minutes and screw on the sprinkler head. After you done test the head and make sure it works properly and after everything is ok, cover the pipe with dirt.