Currently, advanced artificial legs use transducers. Transducers are placed on the bottom of the artificial foot. They send electrical signals to electrodes on the user's skin. The electrodes are attached to a transducers which is in turn connected to the person's stump.
To work, the stump picks up signals from the transducers and then transmit them to the brain just like a natural foot! The brain uses the messages to know the pressure on different parts of the sole. This means the wearer has a feeling of a real leg. This allows him or her to have more control over the leg.
In the future, artificial limbs will allow more sense of feel to hands and feet. They will even be able to detect soft, rough, cold, and hot.