", $result);
$result = str_replace("".htmlentities($job[hp_job_title])."\");";
}
print($result);
}
else{
if($file!=''){$file=trim($file);}
if($form1=='complete' && $email_new=="$email_new2" && $file!='' && $type=='1'){
require_once('recaptchalib.php');
$privatekey = "6LcIzrwSAAAAAH7B0EGhykEqQF6p2QsILbKLzzlE";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
$form1='';
alert('Please re-type the text shown in the image below. Your first attempt did not match. Please remember to re-attach your resume file.');
} else {
$form1='complete';
}
}
if($form1=='complete' && $email_new=="$email_new2" && ($file!='' or $file2!='' or $file3!='' or $file4!='')){
if($ad!=''){
$ad=mysql_real_escape_string($ad);
$select=mysql_query("SELECT * FROM jobs WHERE ad='$ad'");
$select=mysql_fetch_assoc($select);
$select[email]=str_replace(".", "~", $select[email]);
$select[email]=str_replace("@", "`", $select[email]);
if($select[email2]!=''){
$select[email2]=str_replace(".", "~", $select[email2]);
$select[email2]=str_replace("@", "`", $select[email2]);
}
$time=time();
if($type=='1'){
$resume="$file";
$file=$time;
}
$update=mysql_query("UPDATE jobs SET resumes_sent=resumes_sent+1 WHERE ad='$ad'");
if($type=='2'){
if($file==''){$type="1";}
include("sendemail.php");
$header_message="Congratulations";
$message="We have successfully received your resume for this position.