$max_allowed_file_size ){ $ERR['uploaded_file'] .= "\n Size of file should be less than $max_allowed_file_size"; $err = true; } //------ Validate the file extension ----- $allowed_ext = false; for($i=0; $icheck($_POST['captcha_code']) == false) { // the code was incorrect $ERR['captcha_code'] = "The security code entered was incorrect. Please try again."; $err = true; } if (empty($_POST["email"])){ $ERR['email'] = "no email entered"; $err = true; } if (empty($_POST["subject"])){ $ERR['subject'] = "no subject entered"; $err = true; } if (empty($_POST["text"])){ $ERR['text'] = "no text entered"; $err = true; } if ($err){ //do nothing } else{ if ($_POST['option']=="com_contact"){ //copy the temp. uploaded file to uploads folder $upload_folder = "/var/www/html/web.pfsp/www/attachments/"; $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file; $tmp_path = $_FILES["uploaded_file"]["tmp_name"]; if(is_uploaded_file($tmp_path)){ if(!copy($tmp_path,$path_of_uploaded_file)){ $ERR['uploaded_file'] .= '\n error while copying the uploaded file'; $err = true; } } if ($err){ //do nothing } else{ $email = "phil.stenhouse@pfsp.co.uk"; $name = "PFS Web Mailer" ; // Constructing the email $sender = "PFS Web Mailer "; // Your name and email address $recipient = "$name <$email>"; // The Recipients name and email address $subject = $_POST['subject']; // Subject for the email $text = "Vacancy form filled in:\n\nName:\n".$_POST['name'] ."\n\nEmail:\n".$_POST['email'] . "\n\nSubject:\n". $_POST['subject'] ."\n\nText:\n".$_POST['text']; $html = ""; $html .=""; $html .="

Vacancy form filled in

"; $html .="

Name:
".$_POST['name']."

"; $html .="

Email:
".$_POST['email']."

"; $html .="

Subject:
".$_POST['subject']."

"; $html .="

Text:
".$_POST['text']."

"; $html .=""; $html .=""; // HTML version of the email $crlf = "\n"; $headers = array( 'From' => $sender, 'Return-Path' => $sender, 'Subject' => $subject ); // Creating the Mime message $mime = new Mail_mime($crlf); // Setting the body of the email $mime->setTXTBody($text); $mime->setHTMLBody($html); $mime->addAttachment($path_of_uploaded_file, 'text/plain'); // Set body and headers ready for base mail class $body = $mime->get(); $headers = $mime->headers($headers); // SMTP params $smtp_params["host"] = "mail.pfsp.co.uk"; // SMTP host $smtp_params["port"] = "25"; // SMTP Port (usually 25) $smtp_params["auth"] = false; // Sending the email using smtp $mail =& Mail::factory("smtp", $smtp_params); $result = $mail->send($recipient, $headers, $body); if($result == 1){ //all ok $msg = "Your message was sent"; } else { $msg = "Your message was not sent: " . $result; } if (PEAR::isError($result)) $msg = $result->getMessage(); } } } } tops(); echo " \n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "

Vacancies @ PFS & P

\n"; echo "
\n"; if (isset($msg)) { echo "

".$msg."

\n"; } else{ echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "

Current Vacancies

\n"; echo "

\n"; echo "

Service Engineer - Yorkshire, Ideally located in the Leeds Bradford area

\n"; echo "

\n"; echo "

\n"; echo " \n"; echo "

\n"; echo "
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "

Apply Here

\n"; echo "

\n"; echo " All applications must be submitted via our Website, by completion of the form below:\n"; echo "

\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " \n"; if (isset($ERR['name'])) echo "
".$ERR['name']."\n"; echo "
\n"; echo " \n"; echo "
\n"; echo " \n"; if (isset($ERR['email'])) echo "
".$ERR['email']."\n"; echo "
\n"; echo " \n"; echo "
\n"; echo " \n"; if (isset($ERR['subject'])) echo "
".$ERR['subject']."\n"; echo "
\n"; echo " \n"; echo "

\n"; echo " \n"; if (isset($ERR['uploaded_file'])) echo "
".$ERR['uploaded_file']."\n"; echo "
\n"; echo " \n"; echo "

\n"; echo " \"CAPTCHA
\n"; echo " \n"; echo " [ Different Image ]\n"; if (isset($ERR['captcha_code'])) echo "
".$ERR['captcha_code']."\n"; echo "

\n"; echo " \n"; if (isset($ERR['text'])) echo "
".$ERR['text']."\n"; echo "
\n"; echo " \n"; echo "
\n"; echo "
\n"; echo " \n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; } bottoms(); ?>