How to Seal Water Pipes from the Inside?

How can I detect where ruptured water pipes made of high-density polyethylene (HDP) or polyvinyl chloride (PVC) need fixing? 

How can I fix HDP and PVC pipes from the inside? 

Can I use some kind of liquid which solidifies at the point of rupture?