If you realized that you are in the 5th, you must immediately sit for
tashahud without continuing the 5th. You must offer Salam after the two
forgetfulness sujood. However, due to your ignorance, your prayer is
valid.
If you realized that you are in the 5th, you must immediately sit for
tashahud without continuing the 5th. You must offer Salam after the two
forgetfulness sujood. However, due to your ignorance, your prayer is
valid.