When we prayed with the Prophet we used to say, ''Peace be on Allah from His slaves and peace be on so and so.'' The Prophet said, ''Don't say As-Salam be on Allah, for He Himself is As-Salam, but say, At-tahiyatu lil-lahi was-salawatu wat-taiyibatu. As-salamu Alaika aiyuhan-Nabiyu warahmatu-l-lahi wa barakatuhu. As-salamu alaina wa ala ibadillahis-salihin. (If you say this then it will be for all the slaves in heaven or between heaven and earth). Ashhadu an la-ilaha illallahu wa ashhadu anna Muhammadan Abduhu wa Rasuluhu.' Then select the invocation you like best and recite it.'' (See Hadith No. 794, 795 & 796).
When we prayed with the Prophet we used to say: As-Salam be on Allah from His worshipers, As-Salam be on Gabriel, As-Salam be on Michael, As-Salam be on so-and-so. When the Prophet finished his prayer, he faced us and said, ''Allah Himself is As-Salam (Peace), so when one sits in the prayer, one should say, At-Tahiyatu-lillahi Was-Salawatu, Wat-Taiyibatu, As-Salamu Alaika aiyuhan-Nabiyyu wa Rah-matul-lahi wa Barakatuhu, As-Salamu Alaina wa ala Ibadillahi assalihin, for if he says so, then it will be for all the pious slave of Allah in the Heavens and the Earth. (Then he should say), Ash-hadu an la ilaha illalllahu wa ash-hadu anna Muhammadan Abduhu wa rasulu-hu,' and then he can choose whatever speech (i.e. invocation) he wishes '' (See Hadith No. 797, Vol. 1)
We used to say the greeting, name and greet each other in the prayer. Allah's Apostle heard it and said:–''Say, At-tahiyyatu lil-lahi was-salawatu wat-taiyibatu . Assalamu Alaika aiyuha-n-Nabiyu wa-rahmatu-l-lahi wa-barakatuhu. _ Assalamu alaina wa-'ala ibadi-l-lahi as-salihin.. Ashhadu an la ilaha illa-l-lah wa ashhadu anna Muhammadan abdu hu wa Rasuluh. (All the compliments are for Allah and all the prayers and all the good things (are for Allah). Peace be on you, O Prophet, and Allah's mercy and blessings (are on you). And peace be on us and on the good (pious) worshipers of Allah. I testify that none has the right to be worshipped but Allah and that Muhammad is His slave and Apostle.) So, when you have said this, then you have surely sent the greetings to every good (pious) worship per of Allah, whether he be in the Heaven or on the Earth . ''