$sendClient = false;
$captchaError = false;
if (!isset($_POST['token'])) {
$token = md5((time().rand(1,1000)));
}else{
$token = $_POST['token'];
}
if (isset($_POST['origfilename'])) {
$origFileName = $_POST['origfilename'];
}else{
$origFileName = false;
}
function findexts ($filename) {
$filename = strtolower(trim($filename)) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}
function cvUpload($token) {
if (is_uploaded_file($_FILES['cvfile']['tmp_name'])) {
$ext = findexts($_FILES['cvfile']['name']);
$path = 'cvupload4432/'.$token.'.'.$ext;
if (move_uploaded_file($_FILES['cvfile']['tmp_name'],$path)) {
$origFileName = trim($_FILES['cvfile']['name']);
return $origFileName;
}else{
return false;
}
}else{
return false;
}
}
//cv upload
if (isset($_POST['uploadCV'])) {
$origFileName = cvUpload($token);
}
//echo "****Pre SendForm*****";
//email the form here
if (isset($_POST['sendForm'])) {
//echo "****SendForm*****";
require_once('recaptchalib.php');
$privatekey = "6LfjF8ISAAAAAOPQ3gDP0JgdJ_O0bsc_vhT_a-Q-";
$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
$captchaError = true;
// print_r($resp);
} else {
$captchaError = false;
// print_r($resp);
//do file upload here if they forgot to do it at the top
if (is_uploaded_file($_FILES['cvfile']['tmp_name'])) {
$origFileName = cvUpload($token);
}
//loop through the post variable and assign values to keys
$strMailBody = '';
foreach ($_POST as $k => $v) {
if ($k=='MAX_FILE_SIZE' || $k=='token' || $k=='origfilename' || $k=='sendForm') { continue ; }
$strMailBody .= str_replace('_',' ',$k).':'." \n".(($v=='')?'N/A':$v)." \n\n";
}
require_once('class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$mail->From = 'info@visas2australia.co.za';
$mail->FromName = 'Visas 2 Australia';
$mail->Subject = 'Australian Visa Assessment Form';
$mail->Body = $strMailBody;
$mail->AddAddress('info@visas2australia.co.za');
//copy token file name to real name and then send
$ext = findexts($origFileName);
$sourcePath = 'cvupload4432/'.$token.'.'.$ext;
$destinationPath = 'cvupload4432/working/'.$_POST['Name'].'_'.$origFileName;
copy($sourcePath,$destinationPath);
$mail->AddAttachment($destinationPath);
if(!$mail->Send()) {
$sendClient = false;
//echo "Mail send error";
// echo $mail::$ErrorInfo."
***********************";
} else {
$sendClient = true;
//echo "Mail send OK!";
}
}
//echo "****SendForm End*****";
}
//else echo "****No SendForm*****";
?>
|
|
| The assessment form has been successfully sent!'; echo ' |

An assessment of your eligibility for either temporary or permanent residence in Australia is offered free of charge.
The information provided may not be sufficient for us to conduct a full assessment initially. You may therefore, be requested to provide additional information. Please ensure that you provide us with a daytime contact telephone number as well as your e-mail address/es.
Please complete all fields and if available, attach a copy of both your and if relevant, your spouse/partner’s current Curriculum Vitae for an in-depth examination.
If you simply need to make general contact with us and choose not to complete this form, please feel free to e-mail your query and contact details by clicking here
* Vocational information appearing in an attached CV need not be duplicated hereunder.
* If you are in business,
please ensure that this information is clearly indicated below.
In this case, we will make direct contact with you to establish
whether a "business" visa would be
more appropriate.
The reCAPTCHA was not entered corectly, please try again.
'; //echo $_SERVER["REMOTE_ADDR"]." ".$_POST["recaptcha_challenge_field"]." ".$_POST["recaptcha_response_field"]; } ?> }?>