All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The marriage contract is not valid unless certain conditions are met which were previously clarified in Fataawa 83629 and 88488. Announcing the marriage is only recommended and not obligatory. Registering the marriage contract in the court for the purpose of documentation is not among the conditions for the validity of a marriage contract in Islam.
If what took place in the court was the marriage contract by way of offer and acceptance and the presence of the witnesses, or what took place was documentation of a contract which was concluded in a legitimate manner, then it is a valid marriage. However, if it consisted merely in signing marriage papers in court, then it is not an Islamically-valid marriage contract.
Needless to say, prior to concluding the marriage contract the woman is considered a non-Mahram woman to the man, even after the engagement. If the man and woman have intercourse before concluding the marriage contract, this is considered Zina (fornication); it is incumbent on them to repent of such a sin. For more benefit, please refer to Fatwa 86527.
If the woman has given birth to a child after at least six months of the marriage, starting from the date of the valid marriage contract, then the child is attributed to the husband. However, if there was no valid marriage contract concluded in the first place, this is considered a Baatil (void) marriage and the child is attributed to the husband if he believed that the marriage was valid.
Allaah Knows best.