'contact name', 'hospital_name' => 'hospital name', 'department' => 'department', 'direct_line_number' => 'direct line number', 'email' => 'email', 'address' => 'address', 'how_did_you_hear' => 'how did you hear about us', 'booking_requirements' => 'booking requirements', 'information_required' => 'information required' ); foreach($required_fields as $field => $name) { if(empty($_POST[$field])) { $error[] = "{$name} field is required"; } } if(! empty($_FILES['cv']) && ! $_SESSION['uploaded']) { $info = pathinfo($_FILES['cv']['name']); if(in_array($info['extension'], array('doc', 'docx', 'pdf', 'rtf', 'html', 'htm', 'txt'))) { $link = ".cv_upload/" . md5(time()+rand(0,999)) . "." . $info['extension']; if(move_uploaded_file($_FILES['cv']['tmp_name'], $link)) { $_SESSION['uploaded'] = $link; } else { echo "[Move Uploaded File: Failed]"; } } else { #var_dump($info); } } else { #var_dump($_FILES); } // STRIP SLASHES foreach($_POST as $key => $value) { $_POST[$key] = stripslashes($value); } if(! $error) { $message = "WORLD LOCUMS: CLIENT REGISTRATION [received: " . date("d/m/Y @ G:i:s") . "]\n\n"; $message .= "Contact name: {$_POST['contact_name']}\n"; $message .= "Hospital name: {$_POST['hospital_name']}\n"; $message .= "Department: {$_POST['department']}\n"; $message .= "Direct line number: {$_POST['direct_line_number']}\n"; $message .= "Facsimilie number: {$_POST['fax_number']}\n"; $message .= "Email: {$_POST['email']}\n\n"; $message .= "Address:\n"; $message .= "{$_POST['address']}\n\n"; $message .= "Booking requirements:\n"; $message .= "{$_POST['booking_requirements']}\n\n"; $message .= "How did you hear of us?: {$_POST['how_did_you_hear']}\n"; $message .= "Information required?: {$_POST['information_required']}\n"; mail("nick@worldlocums.com", "World Locums: Client Registration", $message, "FROM: World Locums "); include "templates/tpl_client_registration_2.php"; } else { include "templates/tpl_client_registration_1.php"; } } else { include "templates/tpl_client_registration_1.php"; } include "includes/footer.php"; ?>