<?php
// Code submited by Glimpsnet systems inc.
$EmailFrom = Trim(stripslashes($_POST['firstname']));
$sendto = Trim(stripslashes($_POST['sendto']));
$Subject = "APPLICATION.";
//
$firstname = Trim(stripslashes($_POST['firstname']));
$middlename = Trim(stripslashes($_POST['middlename']));
$lastname = Trim(stripslashes($_POST['lastname']));
$gender = Trim(stripslashes($_POST['gender']));
$dob = Trim(stripslashes($_POST['dob']));
$email = Trim(stripslashes($_POST['email']));
$altemail = Trim(stripslashes($_POST['altemail']));
$fax = Trim(stripslashes($_POST['fax']));
$cellphone = Trim(stripslashes($_POST['cellphone']));
$workphone = Trim(stripslashes($_POST['workphone']));
$homephone = Trim(stripslashes($_POST['homephone']));
$workcontact = Trim(stripslashes($_POST['workcontact']));
$streetadd = Trim(stripslashes($_POST['streetadd']));
$city = Trim(stripslashes($_POST['city']));
$state = Trim(stripslashes($_POST['Applicantsname']));
$zipcode = Trim(stripslashes($_POST['zipcode']));
$resume = Trim(stripslashes($_POST['resume']));
$checkbox = Trim(stripslashes($_POST['checkbox']));
// validation
$validationOK=true;
if (Trim($sendto)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=Application.html\">";
// route to error handling page
exit;
}
// prepare email body text
$Body = "";
$Body .= "First Name: ";
$Body .= $firstname;
$Body .= "\n";
$Body .= "Middle Name: ";
$Body .= $middlename;
$Body .= "\n";
$Body .= "Last Name: ";
$Body .= $lastname;
$Body .= "\n";
$Body .= "Gender: ";
$Body .= $gender;
$Body .= "\n";
$Body .= "Date of Birth: ";
$Body .= $dob;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $email;
$Body .= "\n";
$Body .= "Alternate Email: ";
$Body .= $altemail;
$Body .= "\n";
$Body .= "Fax Number: ";
$Body .= $fax;
$Body .= "\n";
$Body .= "Cell Phone: ";
$Body .= $cellphone;
$Body .= "\n";
$Body .= "Work Phone: ";
$Body .= $workphone;
$Body .= "\n";
$Body .= "Home Phone: ";
$Body .= $homephone;
$Body .= "\n";
$Body .= "Can we contact you at work?: ";
$Body .= $workcontact;
$Body .= "\n";
$Body .= "Street Address: ";
$Body .= $streetadd;
$Body .= "\n";
$Body .= "City / Surb / Town : ";
$Body .= $city;
$Body .= "\n";
$Body .= "State: ";
$Body .= $state;
$Body .= "\n";
$Body .= "Zip: ";
$Body .= $zipcode;
$Body .= "\n";
$Body .= "Resume Details: ";
$Body .= $resume;
$Body .= "\n";
// send email
$success = mail($sendto, $Subject, $Body, "Application of: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Intelsoftinc 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.