even if you are in danger you must offer your prayers anyhow on foot or on horseback. and when you have peace again remember allah in the manner he has taught you which you did not know before.
فإن خفتم فرجالا أو ركبانا فإذا أمنتم فاذكروا الله كما علمكم ما لم تكونوا تعلمون