HTML Markup of the form
<div id="form-main"> <div id="form-div"><form id="cvform" class="cvform" action="https://www.healthproclub.com/request/ijtmrph.php" enctype="multipart/form-data" method="post" name="nform"> <table> <tbody> <tr> <td><label for="edit-firstName">First Name <span style="color: red;">*</span></label></td> <td><input id="edit-firstName" name="firstName" required="" type="text" /></td> </tr> <tr> <td><label for="edit-lastName">Last Name <span style="color: red;">*</span></label></td> <td><input id="edit-lastName" name="lastName" required="" type="text" /></td> </tr> <tr> <td><label for="edit-email">Email <span style="color: red;">*</span></label></td> <td><input id="edit-email" name="email" required="" type="text" /></td> </tr> <tr> <td><label for="edit-country">Country <span style="color: red;">*</span></label></td> <td><select id="edit-country" name="country" required=""> <option title="Select country" value="">Select country</option> <option title="AFGHANISTAN" value="AFGHANISTAN">AFGHANISTAN</option> <option title="ALBANIA" value="ALBANIA">ALBANIA</option> <option title="ALGERIA" value="ALGERIA">ALGERIA</option> <option title="AMERICAN SAMOA" value="AMERICAN SAMOA">AMERICAN SAMOA</option> <option title="ANDORRA" value="ANDORRA">ANDORRA</option> <option title="ANGOLA" value="ANGOLA">ANGOLA</option> <option title="ANGUILLA" value="ANGUILLA">ANGUILLA</option> <option title="ANTARCTICA" value="ANTARCTICA">ANTARCTICA</option> <option title="ANTIGUA AND BARBUDA" value="ANTIGUA AND BARBUDA">ANTIGUA AND BARBUDA</option> <option title="ARGENTINA" value="ARGENTINA">ARGENTINA</option> <option title="ARMENIA" value="ARMENIA">ARMENIA</option> <option title="ARUBA" value="ARUBA">ARUBA</option> <option title="ASCENSION" value="ASCENSION">ASCENSION</option> <option title="AUSTRALIA" value="AUSTRALIA">AUSTRALIA</option> <option title="AUSTRIA" value="AUSTRIA">AUSTRIA</option> <option title="AZERBAIJAN" value="AZERBAIJAN">AZERBAIJAN</option> <option title="BAHAMAS" value="BAHAMAS">BAHAMAS</option> <option title="BAHRAIN" value="BAHRAIN">BAHRAIN</option> <option title="BANGLADESH" value="BANGLADESH">BANGLADESH</option> <option title="BARBADOS" value="BARBADOS">BARBADOS</option> <option title="BELARUS" value="BELARUS">BELARUS</option> <option title="BELGIUM" value="BELGIUM">BELGIUM</option> <option title="BELIZE" value="BELIZE">BELIZE</option> <option title="BENIN" value="BENIN">BENIN</option> <option title="BERMUDA" value="BERMUDA">BERMUDA</option> <option title="BHUTAN" value="BHUTAN">BHUTAN</option> <option title="BOLIVIA" value="BOLIVIA">BOLIVIA</option> <option title="BOSNIA AND HERZEGOVINA" value="BOSNIA AND HERZEGOVINA">BOSNIA AND HERZEGOVINA</option> <option title="BOTSWANA" value="BOTSWANA">BOTSWANA</option> <option title="BOUVET ISLAND" value="BOUVET ISLAND">BOUVET ISLAND</option> <option title="BRAZIL" value="BRAZIL">BRAZIL</option> <option title="BRITISH INDIAN OCEAN TERRITORY" value="BRITISH INDIAN OCEAN TERRITORY">BRITISH INDIAN OCEAN TERRITORY</option> <option title="BRUNEI DARUSSALAM" value="BRUNEI DARUSSALAM">BRUNEI DARUSSALAM</option> <option title="BULGARIA" value="BULGARIA">BULGARIA</option> <option title="BURKINA FASO" value="BURKINA FASO">BURKINA FASO</option> <option title="BURUNDI" value="BURUNDI">BURUNDI</option> <option title="CAMBODIA" value="CAMBODIA">CAMBODIA</option> <option title="CAMEROON" value="CAMEROON">CAMEROON</option> <option title="CANADA" value="CANADA">CANADA</option> <option title="CAPE VERDE" value="CAPE VERDE">CAPE VERDE</option> <option title="CAYMAN ISLANDS" value="CAYMAN ISLANDS">CAYMAN ISLANDS</option> <option title="CENTRAL AFRICAN REPUBLIC" value="CENTRAL AFRICAN REPUBLIC">CENTRAL AFRICAN REPUBLIC</option> <option title="CHAD" value="CHAD">CHAD</option> <option title="CHILE" value="CHILE">CHILE</option> <option title="CHINA" value="CHINA">CHINA</option> <option title="CHRISTMAS ISLAND" value="CHRISTMAS ISLAND">CHRISTMAS ISLAND</option> <option title="COCOS (KEELING) ISLANDS" value="COCOS (KEELING) ISLANDS">COCOS (KEELING) ISLANDS</option> <option title="COLOMBIA" value="COLOMBIA">COLOMBIA</option> <option title="COMOROS" value="COMOROS">COMOROS</option> <option title="CONGO" value="CONGO">CONGO</option> <option title="CONGO, THE DEMOCRATIC REPUBLIC OF THE" value="CONGO, THE DEMOCRATIC REPUBLIC OF THE">CONGO, THE DEMOCRATIC REPUBLIC OF THE</option> <option title="COOK ISLANDS" value="COOK ISLANDS">COOK ISLANDS</option> <option title="COSTA RICA" value="COSTA RICA">COSTA RICA</option> <option title="COTE D IVOIRE" value="COTE D IVOIRE">COTE D IVOIRE</option> <option title="CROATIA" value="CROATIA">CROATIA</option> <option title="CUBA" value="CUBA">CUBA</option> <option title="CYPRUS" value="CYPRUS">CYPRUS</option> <option title="CZECH REPUBLIC" value="CZECH REPUBLIC">CZECH REPUBLIC</option> <option title="DENMARK" value="DENMARK">DENMARK</option> <option title="DJIBOUTI" value="DJIBOUTI">DJIBOUTI</option> <option title="DOMINICA" value="DOMINICA">DOMINICA</option> <option title="DOMINICAN REPUBLIC" value="DOMINICAN REPUBLIC">DOMINICAN REPUBLIC</option> <option title="ECUADOR" value="ECUADOR">ECUADOR</option> <option title="EGYPT" value="EGYPT">EGYPT</option> <option title="EL SALVADOR" value="EL SALVADOR">EL SALVADOR</option> <option title="EQUATORIAL GUINEA" value="EQUATORIAL GUINEA">EQUATORIAL GUINEA</option> <option title="ERITREA" value="ERITREA">ERITREA</option> <option title="ESTONIA" value="ESTONIA">ESTONIA</option> <option title="ETHIOPIA" value="ETHIOPIA">ETHIOPIA</option> <option title="FALKLAND ISLANDS (MALVINAS)" value="FALKLAND ISLANDS (MALVINAS)">FALKLAND ISLANDS (MALVINAS)</option> <option title="FAROE ISLANDS" value="FAROE ISLANDS">FAROE ISLANDS</option> <option title="FIJI" value="FIJI">FIJI</option> <option title="FINLAND" value="FINLAND">FINLAND</option> <option title="FRANCE" value="FRANCE">FRANCE</option> <option title="FRENCH GUIANA" value="FRENCH GUIANA">FRENCH GUIANA</option> <option title="FRENCH POLYNESIA" value="FRENCH POLYNESIA">FRENCH POLYNESIA</option> <option title="FRENCH SOUTHERN TERRITORIES" value="FRENCH SOUTHERN TERRITORIES">FRENCH SOUTHERN TERRITORIES</option> <option title="GABON" value="GABON">GABON</option> <option title="GAMBIA" value="GAMBIA">GAMBIA</option> <option title="GEORGIA" value="GEORGIA">GEORGIA</option> <option title="GERMANY" value="GERMANY">GERMANY</option> <option title="GHANA" value="GHANA">GHANA</option> <option title="GIBRALTAR" value="GIBRALTAR">GIBRALTAR</option> <option title="GREECE" value="GREECE">GREECE</option> <option title="GREENLAND" value="GREENLAND">GREENLAND</option> <option title="GRENADA" value="GRENADA">GRENADA</option> <option title="GUADELOUPE" value="GUADELOUPE">GUADELOUPE</option> <option title="GUAM" value="GUAM">GUAM</option> <option title="GUATEMALA" value="GUATEMALA">GUATEMALA</option> <option title="GUINEA" value="GUINEA">GUINEA</option> <option title="GUINEA-BISSAU" value="GUINEA-BISSAU">GUINEA-BISSAU</option> <option title="GUYANA" value="GUYANA">GUYANA</option> <option title="HAITI" value="HAITI">HAITI</option> <option title="HEARD ISLAND AND MCDONALD ISLANDS" value="HEARD ISLAND AND MCDONALD ISLANDS">HEARD ISLAND AND MCDONALD ISLANDS</option> <option title="HOLY SEE (VATICAN CITY STATE)" value="HOLY SEE (VATICAN CITY STATE)">HOLY SEE (VATICAN CITY STATE)</option> <option title="HONDURAS" value="HONDURAS">HONDURAS</option> <option title="HONG KONG" value="HONG KONG">HONG KONG</option> <option title="HUNGARY" value="HUNGARY">HUNGARY</option> <option title="ICELAND" value="ICELAND">ICELAND</option> <option title="INDIA" value="INDIA">INDIA</option> <option title="Indiana" value="Indiana">Indiana</option> <option title="INDONESIA" value="INDONESIA">INDONESIA</option> <option title="IRAN" value="IRAN">IRAN</option> <option title="IRAQ" value="IRAQ">IRAQ</option> <option title="IRELAND" value="IRELAND">IRELAND</option> <option title="ISRAEL" value="ISRAEL">ISRAEL</option> <option title="ITALY" value="ITALY">ITALY</option> <option title="JAMAICA" value="JAMAICA">JAMAICA</option> <option title="JAPAN" value="JAPAN">JAPAN</option> <option title="JORDAN" value="JORDAN">JORDAN</option> <option title="KAZAKHSTAN" value="KAZAKHSTAN">KAZAKHSTAN</option> <option title="KENYA" value="KENYA">KENYA</option> <option title="KIRIBATI" value="KIRIBATI">KIRIBATI</option> <option title="KOREA" value="KOREA">KOREA</option> <option title="KOREA, DEMOCRATIC PEOPLES REPUBLIC OF" value="KOREA, DEMOCRATIC PEOPLES REPUBLIC OF">KOREA, DEMOCRATIC PEOPLES REPUBLIC OF</option> <option title="Kosova" value="Kosova">Kosova</option> <option title="KUWAIT" value="KUWAIT">KUWAIT</option> <option title="KYRGYZSTAN" value="KYRGYZSTAN">KYRGYZSTAN</option> <option title="LAO PEOPLE'S DEMOCRATIC REPUBLIC" value="LAO PEOPLE'S DEMOCRATIC REPUBLIC">LAO PEOPLE'S DEMOCRATIC REPUBLIC</option> <option title="LATVIA" value="LATVIA">LATVIA</option> <option title="LEBANON" value="LEBANON">LEBANON</option> <option title="LESOTHO" value="LESOTHO">LESOTHO</option> <option title="LIBERIA" value="LIBERIA">LIBERIA</option> <option title="LIBYA" value="LIBYA">LIBYA</option> <option title="LIECHTENSTEIN" value="LIECHTENSTEIN">LIECHTENSTEIN</option> <option title="LITHUANIA" value="LITHUANIA">LITHUANIA</option> <option title="LUXEMBOURG" value="LUXEMBOURG">LUXEMBOURG</option> <option title="MACAO" value="MACAO">MACAO</option> <option title="MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF" value="MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF">MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF</option> <option title="MADAGASCAR" value="MADAGASCAR">MADAGASCAR</option> <option title="MALAWI" value="MALAWI">MALAWI</option> <option title="MALAYSIA" value="MALAYSIA">MALAYSIA</option> <option title="MALDIVES" value="MALDIVES">MALDIVES</option> <option title="MALI" value="MALI">MALI</option> <option title="MALTA" value="MALTA">MALTA</option> <option title="MARSHALL ISLANDS" value="MARSHALL ISLANDS">MARSHALL ISLANDS</option> <option title="MARTINIQUE" value="MARTINIQUE">MARTINIQUE</option> <option title="MAURITANIA" value="MAURITANIA">MAURITANIA</option> <option title="MAURITIUS" value="MAURITIUS">MAURITIUS</option> <option title="MAYOTTE" value="MAYOTTE">MAYOTTE</option> <option title="MEXICO" value="MEXICO">MEXICO</option> <option title="MICRONESIA, FEDERATED STATES OF" value="MICRONESIA, FEDERATED STATES OF">MICRONESIA, FEDERATED STATES OF</option> <option title="MOLDOVA, REPUBLIC OF" value="MOLDOVA, REPUBLIC OF">MOLDOVA, REPUBLIC OF</option> <option title="MONACO" value="MONACO">MONACO</option> <option title="MONGOLIA" value="MONGOLIA">MONGOLIA</option> <option title="MONTENEGRO" value="MONTENEGRO">MONTENEGRO</option> <option title="MONTSERRAT" value="MONTSERRAT">MONTSERRAT</option> <option title="MOROCCO" value="MOROCCO">MOROCCO</option> <option title="MOZAMBIQUE" value="MOZAMBIQUE">MOZAMBIQUE</option> <option title="MYANMAR" value="MYANMAR">MYANMAR</option> <option title="NAMIBIA" value="NAMIBIA">NAMIBIA</option> <option title="NAURU" value="NAURU">NAURU</option> <option title="NEPAL" value="NEPAL">NEPAL</option> <option title="NETHERLANDS" value="NETHERLANDS">NETHERLANDS</option> <option title="NETHERLANDS ANTILLES" value="NETHERLANDS ANTILLES">NETHERLANDS ANTILLES</option> <option title="NEW CALEDONIA" value="NEW CALEDONIA">NEW CALEDONIA</option> <option title="NEW ZEALAND" value="NEW ZEALAND">NEW ZEALAND</option> <option title="NICARAGUA" value="NICARAGUA">NICARAGUA</option> <option title="NIGER" value="NIGER">NIGER</option> <option title="NIGERIA" value="NIGERIA">NIGERIA</option> <option title="NIUE" value="NIUE">NIUE</option> <option title="NORFOLK ISLAND" value="NORFOLK ISLAND">NORFOLK ISLAND</option> <option title="NORTHERN MARIANA ISLANDS" value="NORTHERN MARIANA ISLANDS">NORTHERN MARIANA ISLANDS</option> <option title="NORWAY" value="NORWAY">NORWAY</option> <option title="OMAN" value="OMAN">OMAN</option> <option title="PAKISTAN" value="PAKISTAN">PAKISTAN</option> <option title="PALAU" value="PALAU">PALAU</option> <option title="PALESTINIAN TERRITORY, OCCUPIED" value="PALESTINIAN TERRITORY, OCCUPIED">PALESTINIAN TERRITORY, OCCUPIED</option> <option title="PANAMA" value="PANAMA">PANAMA</option> <option title="PAPUA NEW GUINEA" value="PAPUA NEW GUINEA">PAPUA NEW GUINEA</option> <option title="PARAGUAY" value="PARAGUAY">PARAGUAY</option> <option title="PERU" value="PERU">PERU</option> <option title="PHILIPPINES" value="PHILIPPINES">PHILIPPINES</option> <option title="PITCAIRN" value="PITCAIRN">PITCAIRN</option> <option title="POLAND" value="POLAND">POLAND</option> <option title="PORTUGAL" value="PORTUGAL">PORTUGAL</option> <option title="PUERTO RICO" value="PUERTO RICO">PUERTO RICO</option> <option title="QATAR" value="QATAR">QATAR</option> <option title="REUNION" value="REUNION">REUNION</option> <option title="ROMANIA" value="ROMANIA">ROMANIA</option> <option title="RUSSIAN FEDERATION" value="RUSSIAN FEDERATION">RUSSIAN FEDERATION</option> <option title="RWANDA" value="RWANDA">RWANDA</option> <option title="SAINT HELENA" value="SAINT HELENA">SAINT HELENA</option> <option title="SAINT KITTS AND NEVIS" value="SAINT KITTS AND NEVIS">SAINT KITTS AND NEVIS</option> <option title="SAINT LUCIA" value="SAINT LUCIA">SAINT LUCIA</option> <option title="SAINT PIERRE AND MIQUELON" value="SAINT PIERRE AND MIQUELON">SAINT PIERRE AND MIQUELON</option> <option title="SAINT VINCENT AND THE GRENADINES" value="SAINT VINCENT AND THE GRENADINES">SAINT VINCENT AND THE GRENADINES</option> <option title="SAMOA" value="SAMOA">SAMOA</option> <option title="SAN MARINO" value="SAN MARINO">SAN MARINO</option> <option title="SAO TOME AND PRINCIPE" value="SAO TOME AND PRINCIPE">SAO TOME AND PRINCIPE</option> <option title="SAUDI ARABIA" value="SAUDI ARABIA">SAUDI ARABIA</option> <option title="Scotland" value="Scotland">Scotland</option> <option title="SENEGAL" value="SENEGAL">SENEGAL</option> <option title="SERBIA" value="SERBIA">SERBIA</option> <option title="SEYCHELLES" value="SEYCHELLES">SEYCHELLES</option> <option title="SIERRA LEONE" value="SIERRA LEONE">SIERRA LEONE</option> <option title="SINGAPORE" value="SINGAPORE">SINGAPORE</option> <option title="SLOVAKIA" value="SLOVAKIA">SLOVAKIA</option> <option title="SLOVENIA" value="SLOVENIA">SLOVENIA</option> <option title="SOLOMON ISLANDS" value="SOLOMON ISLANDS">SOLOMON ISLANDS</option> <option title="SOMALIA" value="SOMALIA">SOMALIA</option> <option title="SOUTH AFRICA" value="SOUTH AFRICA">SOUTH AFRICA</option> <option title="SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS" value="SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS">SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS</option> <option title="SOUTH KOREA" value="SOUTH KOREA">SOUTH KOREA</option> <option title="SPAIN" value="SPAIN">SPAIN</option> <option title="SRI LANKA" value="SRI LANKA">SRI LANKA</option> <option title="SUDAN" value="SUDAN">SUDAN</option> <option title="SURINAME" value="SURINAME">SURINAME</option> <option title="SVALBARD AND JAN MAYEN" value="SVALBARD AND JAN MAYEN">SVALBARD AND JAN MAYEN</option> <option title="SWAZILAND" value="SWAZILAND">SWAZILAND</option> <option title="SWEDEN" value="SWEDEN">SWEDEN</option> <option title="SWITZERLAND" value="SWITZERLAND">SWITZERLAND</option> <option title="SYRIAN ARAB REPUBLIC" value="SYRIAN ARAB REPUBLIC">SYRIAN ARAB REPUBLIC</option> <option title="TAIWAN" value="TAIWAN">TAIWAN</option> <option title="TAJIKISTAN" value="TAJIKISTAN">TAJIKISTAN</option> <option title="TANZANIA, UNITED REPUBLIC OF" value="TANZANIA, UNITED REPUBLIC OF">TANZANIA, UNITED REPUBLIC OF</option> <option title="THAILAND" value="THAILAND">THAILAND</option> <option title="TIMOR-LESTE" value="TIMOR-LESTE">TIMOR-LESTE</option> <option title="TOGO" value="TOGO">TOGO</option> <option title="TOKELAU" value="TOKELAU">TOKELAU</option> <option title="TONGA" value="TONGA">TONGA</option> <option title="TRINIDAD AND TOBAGO" value="TRINIDAD AND TOBAGO">TRINIDAD AND TOBAGO</option> <option title="TRISTA DA CUHNA" value="TRISTA DA CUHNA">TRISTA DA CUHNA</option> <option title="TUNISIA" value="TUNISIA">TUNISIA</option> <option title="TURKEY" value="TURKEY">TURKEY</option> <option title="TURKMENISTAN" value="TURKMENISTAN">TURKMENISTAN</option> <option title="TURKS AND CAICOS ISLANDS" value="TURKS AND CAICOS ISLANDS">TURKS AND CAICOS ISLANDS</option> <option title="TUVALU" value="TUVALU">TUVALU</option> <option title="UGANDA" value="UGANDA">UGANDA</option> <option title="UKRAINE" value="UKRAINE">UKRAINE</option> <option title="UNITED ARAB EMIRATES" value="UNITED ARAB EMIRATES">UNITED ARAB EMIRATES</option> <option title="UNITED KINGDOM" value="UNITED KINGDOM">UNITED KINGDOM</option> <option title="UNITED STATES" value="UNITED STATES">UNITED STATES</option> <option title="UNITED STATES MINOR OUTLYING ISLANDS" value="UNITED STATES MINOR OUTLYING ISLANDS">UNITED STATES MINOR OUTLYING ISLANDS</option> <option title="URUGUAY" value="URUGUAY">URUGUAY</option> <option title="UZBEKISTAN" value="UZBEKISTAN">UZBEKISTAN</option> <option title="VANUATU" value="VANUATU">VANUATU</option> <option title="VENEZUELA" value="VENEZUELA">VENEZUELA</option> <option title="VIETNAM" value="VIETNAM">VIETNAM</option> <option title="VIRGIN ISLANDS, BRITISH" value="VIRGIN ISLANDS, BRITISH">VIRGIN ISLANDS, BRITISH</option> <option title="VIRGIN ISLANDS, U.S." value="VIRGIN ISLANDS, U.S.">VIRGIN ISLANDS, U.S.</option> <option title="WALLIS AND FUTUNA" value="WALLIS AND FUTUNA">WALLIS AND FUTUNA</option> <option title="West Indies" value="West Indies">West Indies</option> <option title="WESTERN SAHARA" value="WESTERN SAHARA">WESTERN SAHARA</option> <option title="YEMEN" value="YEMEN">YEMEN</option> <option title="ZAMBIA" value="ZAMBIA">ZAMBIA</option> <option title="ZIMBABWE" value="ZIMBABWE">ZIMBABWE</option> </select></td> </tr> <tr> <td><label for="edit-expertise">Field of expertise <span style="color: red;">* </span></label></td> <td><input id="edit-expertise" name="expertise" required="" type="text" /></td> </tr> <tr> <td><label for="edit-comment">Comment </label></td> <td><textarea id="edit-comment" name="message"></textarea></td> </tr> <tr> <td><label for="edit-resume">Upload CV <span style="color: red;">*</span><br /><em>(pdf, docx or doc only) </em></label></td> <td><input id="edit-resume" accept=".doc,.docx,.pdf" name="resume" required="" type="file" /></td> </tr> <tr> <td>Security check</td> <td> </td> </tr> <tr> <td> </td> <td> <div><button id="okemail" class="proceed" name="submit" type="submit">SUBMIT</button></div> </td> </tr> </tbody> </table> </form></div> </div>
CSS Style
JavaScript
<!~--Email Verification--> <script> window.onload = function() { document.getElementById('cvform').onsubmit = validateEmail; } function validateEmail() { var emailText = document.getElementById('edit-email').value; var pattern = /^[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*@[a-z0-9]+(\-[a-z0-9]+)*(\.[a-z0-9]+(\-[a-z0-9]+)*)*\.[a-z]{2,4}$/; if (pattern.test(emailText)) { return true; } else { alert('Bad email address: ' + emailText); return false; } } </script>
PHP Script
<?php // check if fields passed are empty if(empty($_POST['firstName']) || empty($_POST['lastName']) || empty($_POST['email']) || empty($_POST['country']) || empty($_POST['expertise']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } // Submit if(isset($_POST['submit'])){ $fileName=$_FILES["resume"]["name"]; $fileSize=$_FILES["resume"]["size"]/1024; $fileType=$_FILES["resume"]["type"]; $fileTmpName=$_FILES["resume"]["tmp_name"]; $statusMsg = ''; $random=rand(1111,9999); $newFileName=$random.str_replace(' ', '-', $fileName); //file upload path $targetDir = "../resume/reviewer/"; $fileName = basename($_FILES["resume"]["name"]); $targetFilePath = $targetDir . $newFileName; $fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION); if(!empty($_FILES["resume"]["name"])) { //allow certain file formats //$allowTypes = array('jpg','png','jpeg','gif','pdf','docx','doc'); $allowTypes = array('pdf','docx','doc'); if(in_array($fileType, $allowTypes)){ //upload file to server if(move_uploaded_file($_FILES["resume"]["tmp_name"], $targetFilePath)){ $statusMsg = "The file ".$fileName. " has been uploaded."; }else{ $statusMsg = "Sorry, there was an error uploading your file."; } }else{ $statusMsg = 'Sorry, only DOC,DOCX, & PDF files are allowed to upload.'; } }else{ $statusMsg = 'Please select a file to upload.'; } //display status message echo $statusMsg; } //reCAPTCHA validation if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) { $secret = 'YOUR_RECAPTCHA_SITE_KEY'; $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']); $responseData = json_decode($verifyResponse); if($responseData->success) { $succMsg = 'Your contact request have submitted successfully.'; } else { $errMsg = 'Robot verification failed, please try again.'; } } # RESULT PAGE $location = "https://ijtmrph.org/index.php/IJTMRPH/thank-you-ijtmrph-reviewer"; ## FORM VALUES ## $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $email_address = $_POST['email']; $country = $_POST['country']; $expertise = $_POST['expertise']; $message = $_POST['message']; // create email body and send it $to = 'bdhostit@gmail.com'; $email_subject = "IJTMRPH Reviewer Request by $lastName"; // EDIT THE EMAIL SUBJECT LINE HERE $email_body = "<h4>You have received a new Reviewer Member Request.</h4> Here are the details:<br /> <strong>First Name:</strong> $firstName <br /> <strong>Last Name:</strong> $lastName <br /> <strong>Email:</strong> $email_address <br /> <strong>Country:</strong> $country <br /> <strong>Field of expertise:</strong> $expertise <br /> <strong>Comments:</strong> $message <br /> <strong>Resume:</strong> <a href='https://ijtmrph.org/resume/reviewer/$newFileName' download='Resume'>Download</a>"; $headers = "From: $lastName <$email_address>\n"; $headers .= "Reply-To: $email_address"; // HTML email $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html;\r\n"; mail($to,$email_subject,$email_body,$headers); header( "Location: $location" ); return true; ?>
Leave a Reply