Upon entering the mosque, a Muslim should be in a state of purification, he should dress appropriately, and apply perfume, if he is able to do so. Allah Almighty orders the sons of Adam to take their adornments upon entering mosques saying, (O Children of Adam! Look to your adornment at every place of worship, and eat and drink, but be not prodigal…) (Al-A`raf 7:31)
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states the following: There is no hard and fast rule to follow while visiting mosques, except for the fact that while doing so, we must cherish good intention, proceed to the mosque while in a state of purification, and consider our stay in the mosque as an act of worship.
Having said this, however, I must point out that there are certain things that are highly recommended for us to do while visiting mosques:
1. Being in a state of purification.
2. Attiring oneself appropriately and applying some nice scent or perfume [this is for men only];
3. Formulating the intention of visiting the House of Allah for sake of worship;
4. While stepping out of the house, one should supplicate as follows:
Bismillahi tawakkaltu `ala Allah laa hawla walaa quwwata illaa bi Allah
(In the name of Allah; I place my trust in Allah; there is no strength, nor power [to do good or shun evil] except by the will of Allah);
5. Upon entering the mosque, place the right foot first and say:
Bismillah; Allahumma iftah lee abwaaba rahmatika
(In the name of Allah; O Allah, open Your doors of mercy for me).