There was an error processing your input."); define("MSG_SEND_SUCCESS","

Link sent successfully to your friend!

"); define("MSG_SEND_FAILURE","

There was an error sending the mail! Please contact info@coolavenues.com for this incident!

"); define("MSG_BACK_TO_ARTICLE","Back to the article you were reading."); //Mail template // Use the following position specifiers // 1 = recipient name, 2 = recipient mail, 3 = sender name, 4 = sender mail, 5 = link, // 6 = description $MSG_MAIL_HTML = << Your friend %3\$s has send you a suitable job opening at the following link!

%5\$s

He also sent following comments!

%6\$s

- From the Coolavenues team

END; $MSG_MAIL_TEXT = <<>NOT<< edit after this point. ***************************************************************** ***************************************************************** ***************************************************************** */ //Is this script being bookmarked or run directly? if (isset($_SERVER["HTTP_REFERER"])) { $referrer = $_SERVER["HTTP_REFERER"]; } else { err(MSG_ERR_NOTDIRECT); } //Is somebody trying to abuse this script from some other site? if(strpos(strtoupper($referrer),strtoupper($lock_to_path)) !== 0) { err(MSG_ERR_INVALIDLINK); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $ret = accept_form_vars(); if ($ret) { redirect_back($ret); } if (send_mail()) { show_success(); } else { show_failure(); } } else { show_form(); } //Script ENDS //////////////// FUNCTIONS ////////////////// function html_start($title="") { global $html_include_before; if (file_exists($html_include_before) && is_file($html_include_before) && is_readable($html_include_before)) { $content= file_get_contents($html_include_before); if ($content) { return $content; } } return << $title END; } function html_end() { global $html_include_after; if (file_exists($html_include_after) && is_file($html_include_after) && is_readable($html_include_after)) { $content= file_get_contents($html_include_after); if ($content) { return $content; } } return << END; } function err($msg="") { $m =<<$msg END; die(html_start("Error").$m.html_end()); } function show_form() { global $referrer; print html_start(); ?>
Thank you for recommending our website to your friend. You have decided to send the following link to your friend:
Please enter some details about your friend here.
Name    Email


Please enter some details about you here.
Name    Email
You can optionally add your comments to the mail we are going to send to your friend.
   
'.$msg.'
'; print "Back"; print html_end(); exit(1); } function show_success() { global $referrer; print html_start(); print MSG_SEND_SUCCESS; print "".MSG_BACK_TO_ARTICLE.""; print html_end(); return true; } function show_failure() { global $referrer; print html_start(); print MSG_SEND_FAILURE; print "".MSG_BACK_TO_ARTICLE.""; print html_end(); return true; } function send_mail() { global $rmail, $rname, $sname, $smail, $referrer, $desc, $MSG_MAIL_HTML, $MSG_MAIL_TEXT, $phpmailer_path, $MSG_MAIL_SUBJECT; include_once($phpmailer_path."/class.phpmailer.php"); $message = new PHPMailer(); $message->From = $smail; $message->FromName = $sname; $message->Mailer = "sendmail"; $message->Body = sprintf($MSG_MAIL_HTML,$rname,$rmail, $sname, $smail,$referrer,$desc); $message->Subject = $MSG_MAIL_SUBJECT; // printf($MSG_MAIL_HTML,$rname,$rmail, $sname, $smail,$referrer,$desc); $message->AltBody = sprintf($MSG_MAIL_TEXT,$rname,$rmail, $sname, $smail,$referrer, $desc); $message->AddAddress($rmail,$rname); return $message->Send(); // return true; } ?>