I am using the code which i have attached but it generates errors.... the first error is in this line 36.
if (isset($_POST[$MM_flag])){
if(empty($_POST['first_name'] || empty($_POST['last_name'])){
$error['name'] = 'Please enter your full name; name and surname';
}