Anas reported that when God’s messenger entered the privy he used to say, "O God, I seek refuge in Thee from male and female devils.”*
*One might be inclined to translate this phrase as "from infidelity and act of disobedience,”
but the tradition from Zaid b. Arqam (p. 76) is very explicit, and so the translation above is probably the correct one.
PT-2 (12-71.)
Salman said, “He (meaning God’s messenger) forbade us to face the qibla when easing ourselves or passing water, or to wipe ourselves with the right hand, or to wipe ourselves with less than three stones, or to wipe ourselves with dung or bone.”
Ibn ‘Abbas told that the Prophet came upon two graves and said, "Their occupants are being punished, but not for a great sin. One of them did not keep himself from being defiled by urine. (A version by Muslim has "did not keep himself undefiled by urine”.) The other went about spreading slander.” He then took a fresh palm branch, split it in two parts, and planted one on each grave. On being asked why he did this, he said, "Perhaps their punishment may be mitigated as long as they remain fresh.”
Abu Ayyub al-Ansari reported God’s messenger as saying, "When you go to the toilet neither face nor turn your back to the qibla , but turn towards the east or the west.” (Bukhari and Muslim.) The shaikh and imam Muhyi as-Sunna said that this tradition applies to the desert, but that in a built-up area it does not matter, on account of what is transmitted from ‘Abdallah b. ‘Umar who said, "I went up to the roof of Hafsa’s house for some purpose and saw God's messenger relieving himself facing Syria, with his back to the qibla.”