As an added note, the word "toilet" in this article refers only to the area immediately surrounding the place of relief and not, as is commonly understood in English, the entire bathroom.
As an added note, the Prophet said, "To put a barrier that will prevent the jinn from seeing the 'awrah of the sons of Aadam, let any one of you say 'Bismillaah' when entering the toilet." 
One should enter the toilet with the left foot first  and say whilst entering:
" Bismillăhi, 'allăhumma 'innee 'a`outhu bika minal-khubthi wal khabă'ithi" 
[In the Name of Allaah; my 'ilăh I seek refuge in You from the male, and female devils (shayateen, which is the plural for shaytan)].
It is known that the jinn like to inhabit places
of filth, such as toilets and camel pens and that is why we have been ordered
to seek refuge in Allaah from their harm when we enter the toilet. 
One should always move and hide away from others
when relieving oneself. Jaabir
relates that, "When the Prophet
felt the need of relieving himself, he
went far off where no one could see him." 
would also take the added precaution of not raising his
garment until he
had lowered himself near the ground ,
since, even tough he
would go to a far off place to relieve himself ,
the area was still open, so there was still the possibility of being seen.
This is an indication of extreme sense of modesty and shyness which the
possessed. In contrast, we see the disbelievers, especially the men, who
feel no shame in using public urinals, exposing themselves to everyone.
There are certain places which we have been expressly told to avoid when
relieving oneself. The Prophet
said, "Beware of those acts which cause other to curse." They asked,
"What are those acts", he
said, "Relieving yourself in the people's pathways or in their shade
[under trees]."  This hadeeth
illustrates beautifully how Islaam safeguards the rights of one and all.
Again, in marked contrast to this, we find the manners of the disbelievers,
whose inconsiderate behavior leaves foul stenches in several phone booths
and subways. Not only that, but they see no wrong in walking their dogs
with the specified purpose of fouling the paths, causing harm and offensive
3. THE PROHIBITION OF FACING THE QIBLAH: 
The Prophet said, "If you go to defecate, do not face the Qiblah nor turn your back toward it. Instead you should turn to your left side or your right."  Some scholars are of the opinion that this forbidding only applies in open areas and that if you are in an enclosed place, then there is no harm relieving yourself facing the Qiblah or with your back towards it. Ibn 'Umar , said, "If there is between you and the Qiblah, something shielding you, there is no harm in it." 
The more correct opinion however (and Allaah knows
best), seems to be that it is something forbidden in both and open and
concealed areas and it is best to refrain from doing so as far as possible
out of respect for the direction which we pray in. The problem which faces
many people regarding this issue is what to do if the toilets that they
use are positioned in such a way that they cannot help but face or have
their back toward the Qiblah. The answer to this can be found in the example
of the Companions ,
for they too faced this problem after they had conquered Shaam (Syria)
which had formerly been occupied by the Christians. The Companions
mentioned that when they had to use these toilets, then when they came
out, they would ask for Allaah's forgiveness. 
It is recommended (mustahabb) to urinate whilst
sitting or squatting and not standing, since this was the usual practice
of the Prophet .
It is not forbidden (haraam) to stand whilst urinating since the Prophet
is also reported to have done so, but sitting/squatting is better since
this is healthier for the body and because there is less chance of urine
splashing onto one's body or clothes. Great care must be taken to avoid
the splatter of urine on oneself, since urine is something impure. The
once passed by two graves and said:
"Both are being punished. They are not being punished for major [sins]. One did not shield himself from urine and the other carried gossip." 
It is forbidden to use the right hand in order to clean oneself from the impurities of urine and feces. The Prophet said, "None of you should touch his privates with his right hand whilst urinating nor should he wipe of feces with his right." 
As for the material which should be used for cleaning, then we can use either dry material (i.e. tissue paper, stones, etc.) or water. It is permissible to use one or the other, or both and out of the two, water is better. This is known by the fact that the aayah,
"Allaah loves those who make themselves clean
(Surah At-Tawbah (The Repentance) Verse 108)
was revealed in connection with the Ansaar (the
Helpers) of the Qoobaa (near al-Madeenah) because they would use water
to cleanse themselves after going to the toilet. 
This was also the usual practice of the Prophet .
 There are three requirements
for the dry material if it is to be used to clean oneself: [i] it must
be something pure in itself (i.e. tissue paper, pebbles); [ii] it must
not be something which is respected (i.e. a book) or something which is
of use (i.e. food, clothes etc.); [iii] the private parts must be wiped
at least three times with clean parts of that material. 
After cleaning the private parts, one should clean one's hands. Abu Hurayrah
related that after cleansing himself, the Prophet
would rub his hand on the ground (to clean it) and then he would perform
6. STEPPING OUT:
The Prophet would exit the toilet area with his right foot first and seek Allaah's forgiveness. 'Aa'ishah reported that when he left the toilet, he would say:
([I ask] Your forgiveness). 
May Allaah grant us the ability to model our whole
life on that of the Prophet's
and may He bless us with those actions which are pleasing to Him. He is
the best One to ask and the greatest One who responds.
1. Reported by al-Tirmidhi,
551; Saheeh al-Jaami', 3611
2. Since the toilets in the time of the Prophet were not confined to a structural building, but rather the open space was used, there is no proof for entering with the left foot. However, Ibn Hajar in Fathul Baaree says that "…it may be understood by some by the Prophet's love of beginning good and pure things with the right hand/side that this (entering the toilet) falls into the opposite category."
3. Narrated by Anas bin Maalik and collected in Saheeh al-Bukharee (Volume 1, Book 4, Number 144) and Saheeh Muslim (Book 003, Number 729).
4. It is also the reason why we have been prohibited to pray in toilets, camel pens and the like. See Sunan Abu Daawood (Book 2, Number 0492, Book 1, Number 0184) and others.
5. Collected in Saheeh Muslim (Book 002, Number 0519) and Sunan Abu Daawood (Book 1, Number 0002).
6. Saheeh Narrated by Abdullah ibn Umar and collected by Abu Daawood (Book 1, Number 0014).
7. Narrated by Abu Hurairah and collected in Saheeh Muslim (Book 002, Number 0516) and others. The Prophet also prohibited relieving oneself in standing water (i.e. swimming pools etc.) [Saheeh Muslim (Book 002, Number 553)].
8. The Qiblah is the direction of the Ka'bah in Makka i.e. the direction which Muslims face when we pray.
9. Narrated by Abu Ayyoob al Ansaaree and collected in Saheeh al-Bukharee (Volume 1, Book 4, Number 146) and Saheeh Muslim (Book 002, Number 0507).
10. Hasan - Collected in Sunan Abu Daawood (Book 1, Number 0011) and others. Authenticated by Shaykh Al-Albani in Saheeh Sunan Abee Dawood (1/8).
11. Saheeh - Collected in Sunan Abu Daawood (Book 1, Number 0009) and others. Authenticated by Shaykh Al-Albani in Saheeh Sunan Abee Dawood (1/7).
12. Collected by Abu Daawood (Book 1, Number 0022). Declared saheeh by Shaykh Al-Albani in Saheeh Sunan Abee Dawood (1/16).
13. Narrated by Ibn Abbaas and collected in Saheeh al-Bukharee (Volume 1, Book 4, Number 217) and Saheeh Muslim (Book 002, Number 575).
14. Narrated by Abu Qataadah and collected in Saheeh al-Bukharee (Volume 1, Book 4, Number 155) and Saheeh Muslim (Book 002, Number 513).
15. Saheeh - Narrated by Abu Hurairah and collected in Sunan Abu Daawood (Book 1, Number 0044) Authenticated by Shaykh Al-Albani in Saheeh Sunan Abee Dawood.
16. Narrated by Anas and collected in Saheeh al-Bukharee (Volume 1, Book 4, Number 152).
17. Narrated by Salmaan al-Faarsee and collected in Saheeh Muslim (Book 002, Number 504). It should perhaps be mentioned (for the sake of completeness) that the use of dung and bones to clean oneself is also prohibited, the reason being that our brothers for the Jinn find food on it. [See Buhkharee Volume 5, Book 58, Number 200].
18. Hasan - Reported by Abu Daawood (Book 1, Number 0035). Authenticated by Shaykh Al-Albani in Saheeh Sunan Abee Dawood. (#35).
19. Saheeh - Collected in Sunan Abu Daawood (Book 1, Number 0030) and at-Tirmidhee. Declared saheeh by Shaykh Al-Albani in Saheeh at-Tirmidhee (1/7).