require("utils.php");
utils_magicQuotesRemove ($_POST ); //remove magic quotes
$send = $_POST['send'];
if ( $send != "" ){
if ($error = this_validateform() ){
$ERROR_MESSAGE = $error;
}else{
this_sendEmailInfo( "nataliya@performancesystems.com" );
header("Location: careers_confirmation.html" );
exit;
}
}
//Format error message (if any)
if ( $ERROR_MESSAGE != "" ){
$ERROR_MESSAGE = sprintf('%s ', $ERROR_MESSAGE );
}
//######################################################################################
//## PHP function declarations begin here
//######################################################################################
function this_validateform(){
$nonempties = array("name"=>"provide your Name", "email"=>"provide your email", "cover"=>"paste your Cover Letter");
foreach( $nonempties as $afield=>$desc ){
if ( is_numeric( $afield ) ) {
continue;
}
if ( trim($_POST[ $afield ]) == "" ){
return "Please " . $desc;
}
}
if ( $error = utils_validateemail( $_POST['email'], false, "" ) ) {
return $error;
}
return "";
}
function this_sendEmailInfo( $toemail ){
//$from_header = "From: info@".$_SERVER['SERVER_NAME']. "\r\n";
$from_header = "From: info@performancesystems.com\r\n";
$name = $_POST['name'];
$email= $_POST['email'];
$cover = $_POST['cover'];
$body = "Online Resume Submission \n\n".
"From: $name \n".
"Email: $email \n\n".
"Cover Letter: \n".
$cover ."\n\n";
mail( $toemail ,
"Online Resume Submission",
$body , $from_header) ;
}
?>
Performance Systems - Marketing Innovations