'title', 'first_name' => 'first name', 'surname' => 'surname', 'address' => 'address', 'town_city' => 'town/city', 'county_state' => 'county/state', 'postcode' => 'post code', 'country' => 'country', 'gender' => 'gender', 'email' => 'email address', 'work_type' => 'work type', 'pay_expected' => 'pay expected', 'current_employment' => 'current employment' ); 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: CANDIDATE REGISTRATION [received: " . date("d/m/Y @ G:i:s") . "]\n\n"; $message .= "Personal Details\n"; $message .= "---------------------------\n"; $message .= "Name: {$_POST['first_name']} {$_POST['surname']}\n\n"; $message .= "Address:\n"; $message .= "{$_POST['address']}\n"; $message .= "{$_POST['town_city']}\n"; $message .= "{$_POST['county_state']}\n"; $message .= "{$_POST['postcode']}\n"; $message .= "{$_POST['country']}\n\n"; $message .= "Tel. (home): {$_POST['tel_home']}\n"; $message .= "Tel. (work): {$_POST['tel_work']}\n"; $message .= "Tel. (mobile: {$_POST['tel_mobile']}\n\n"; $message .= "Email: {$_POST['email']}\n\n"; $message .= "DOB: {$_POST['dob']}\n"; $message .= "Gender: {$_POST['gender']}\n\n"; $message .= "Employment Details\n"; $message .= "---------------------------\n"; $message .= "Speciality: {$_POST['speciality']}\n"; $message .= "Work type: {$_POST['work_type']}\n"; $message .= "Pay expected: {$_POST['pay_expected']} {$_POST['pay_currency']} / {$_POST['pay_duration']}\n\n"; $message .= "Current Employment:\n"; $message .= "{$_POST['current_employment']}\n\n"; $message .= "Candidate CV\n"; $message .= "---------------------------\n"; if(! $_SESSION['uploaded']) { $message .= "No CV uploaded"; } else { $message .= "http://worldlocums.com/registration/" . $_SESSION['uploaded'] . "\n\n"; } mail("nick@worldlocums.com", "World Locums: Candidate Registration", $message, "FROM: World Locums "); include "templates/tpl_registration_2.php"; } else { include "templates/tpl_registration_1.php"; } } else { include "templates/tpl_registration_1.php"; } include "includes/footer.php"; ?>