rendered paste body<?php$labels = array ('first_name' => 'First Name: ','middle_name' => 'Middle Name: ','second_name' => 'Second Name: ','tel' => 'Tel: ');if(count($_POST) == 0) {echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post"><table>';foreach($labels as $field => $value){ echo '<tr><td>'.$value.'</td><td><input type="text" name="'.$field.'" size="15"></td></tr>';}echo '</table><input type="submit" value="Sumit">';echo '</form>';exit();} else {foreach($_POST as $field => $values){ if($field != 'middle_name') { if($value == '') { $blank_array[] = $field; } }}if(count($blank_array) > 0){ echo '<b>You didn\'t fill in one or more required fields. You must enter:<br>'; foreach($blank_array as $value) { echo $value.'<br>'; } echo '<table><form action="'.$_SERVER['PHP_SELF'].'" method="post">'; foreach($labels as $field => $value) { $good_data[$field] = strip_tags(trim($_POST[$field])); echo '<tr><td>'.$labels[$field].'</td><td><input type="text" name="'.$field.'" size="15" maxlength="15" value="'.$good_data[$field].'"></td></tr>'; } echo '<tr><td><input type="submit" value="Sumit"></td></tr>'; echo '</form></table>'; exit();}}?>