Narrated Imran bin Hussein: I had piles, so I asked the Prophet, peace be upon him, about the Salat. He said, “Offer Salat standing and if you cannot do that, offer Salat sitting, and if you cannot do even that, then offer Salat lying on your side.
[2: 218- O.B. Sahih Al-Bukhari)