Code of Alabama
Article 2 - Guilty Pleas.
Section 15-15-23 - Hearing of Testimony; Receiving of Plea; Entry of Judgment; Sentencing of Defendant.

(a) Upon the date fixed for the formal plea of guilty by a defendant, the court shall proceed to hear the testimony of any witnesses who may be summoned or offered either by the state or by the defendant or whom the court may direct to be summoned, and it must hear also the testimony of the defendant.
(b) If after hearing the testimony the court believes beyond a reasonable doubt that the defendant is guilty, in manner and form, of the offense charged against him in the information provided for in Section 15-15-21, the court shall thereupon receive and enter the plea of guilty of such defendant, shall enter judgment of conviction thereon and shall sentence the defendant to such term in the penitentiary as is prescribed by law, any other provisions of the law to the contrary notwithstanding.