(13) باب الدُّعَاءِ عِنْدَ دُخُولِ الْمَسْجِدِ .
It was narrated that Fatimah the daughter of the Messenger of Allah said:
"Whenever the Messenger of Allah entered the mosque he would say: 'Bismillah, was-salamu 'ala Rasulillah, Allahummagh-firli dhunubi waftah li abwaba rahmatika. (In the Name of Allah, and peace be upon the Messenger of Allah. O Allah, forgive me my sins and open to me the gates of Your mercy).' When he left he would say: 'Bismillah, was-salamu 'ala Rasulillah, Allahummagh-firli dhunubi waftah li abwaba fadlika. (In the Name of Allah, and peace be upon the Messenger of Allah. O Allah, forgive me my sins and open to me the gates of Your bounty).'"
Reference: Sunan Ibn Majah 771
In-book reference: Book 4, Hadith 37
English translation: Vol. 1, Book 4, Hadith 771