Hadith 1212

It was narrated that ‘Abdullah said: “The Messenger of Allah (saw) said: ‘If anyone of you is uncertain about his prayer, let him try to do what is correct then let him prostrate twice.’”
Tanafisi said: "This is the basic rule, and no one is able to reject it."

حَدَّثَنَا عَلِيُّ بْنُ مُحَمَّدٍ، حَدَّثَنَا وَكِيعٌ، عَنْ مِسْعَرٍ، عَنْ مَنْصُورٍ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، عَنْ عَبْدِ اللَّهِ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ ‏"‏ إِذَا شَكَّ أَحَدُكُمْ فِي الصَّلاَةِ فَلْيَتَحَرَّ الصَّوَابَ ثُمَّ يَسْجُدْ سَجْدَتَيْنِ ‏"‏ ‏.‏ <br> قَالَ الطَّنَافِسِيُّ هَذَا الأَصْلُ وَلاَ يَقْدِرُ أَحَدٌ يَرُدُّهُ ‏.‏

Reference: 1312680
In-book reference: Book 5, Hadith 1212