Please indicate: "'.$strFieldName.'"'; }elseif(strlen($strInput)>$intMaxLength){ return '
"'.$strFieldName.'" field is too long. (max '.$intMaxLength.' characters)'; }else{ return ''; } } function strip_magic_slashes($str){ //added this function as a workaround to the php magic quotes thing return get_magic_quotes_gpc() ? stripslashes($str) : $str; } //sendEmail function abbreviated function sendEmail($to,$from) { $mail = new PHPMailer(); $mail->From = $from; // $mail->FromName = $fromName; //$mail->Host = "mail-relay.tru.ca"; //$mail->Host = SMTPSERVER; $mail->Host = 'mail-relay.tru.ca'; // $mail->Subject = $subject; $mail->Mailer = "smtp"; // $mail->Body = $body; $mail->AddAddress($to); if(!$mail->Send()) { return 0; } return 1; } //clean data in _REQUEST $dataFilter = new InputFilter($tags, $attr, $tag_method, $attr_method, $xss_auto); $_POST = $dataFilter->process($_POST); //declare variables $error_msg = ""; $btnSubmit = isset($_POST['btnSubmit']) ? trim($_POST['btnSubmit']) : ""; $form_email = isset($_POST["form_email"]) ? trim($_POST['form_email']) : ""; $listtype1 = isset($_POST["listtype1"]) ? trim($_POST['listtype1']) : ""; $listtype2 = isset($_POST["listtype2"]) ? trim($_POST['listtype2']) : ""; $listtype3 = isset($_POST["listtype3"]) ? trim($_POST['listtype3']) : ""; $listtype4 = isset($_POST["listtype4"]) ? trim($_POST['listtype4']) : ""; $listtype5 = isset($_POST["listtype5"]) ? trim($_POST['listtype5']) : ""; $form_action = isset($_POST["form_action"]) ? trim($_POST['form_action']) : ""; ?>
Please check at least one Careeer Posting Category'; } $error_msg.= ValidOptionEntered($form_action, 'Subscribe or Unsubscribe', 100); if(strlen($error_msg)!=0) { ?>
Your email address:
Check the Career Postings you are interested in:
> Administrator Positions
> Support Postitions
> Faculty Positions
> Open Learning Faculty Member Positions
> Curriculum Development Positions
> Subscribe >Unsubscribe
$error_msg";?>
process($_POST); //get the cleaned POST data (use the strip_magic_slashes function where we want to allow single quotes) $form_email = isset($_POST["form_email"]) ? strip_magic_slashes(trim($_POST['form_email'])) : ""; //subscribe or unsubscribe $form_action = isset($_POST["form_action"]) ? strip_magic_slashes(trim($_POST['form_action'])) : ""; $tostring=""; if ($form_action == '-leave') { $tostring = '-leave@news.tru.ca'; } else { $tostring = '-join@news.tru.ca'; } //if no errors so far (no errors saving to database) then send an email if(strlen($error_msg)==0) { if($listtype1=="administration_job_ops") { $emailsent=sendEmail($listtype1.$tostring,$form_email); } if($listtype2=="faculty_job_ops") { $emailsent=sendEmail($listtype2.$tostring,$form_email); } if($listtype3=="support_job_ops") { $emailsent=sendEmail($listtype3.$tostring,$form_email); } if($listtype4=="olfm_job_ops") { $emailsent=sendEmail($listtype4.$tostring,$form_email); } if($listtype5=="currdev_job_ops") { $emailsent=sendEmail($listtype5.$tostring,$form_email); } //Send email echo "Thank you

You will receive an email requesting a confirmation response
"; //check for email sending errors here? if(!$emailsent) { $error_msg.="there was an error sending the message"; } } } } else { $form_action=$_GET['action']; $form_listtype1=$_POST['listtype1']; $form_listtype2=$_POST['listtype2']; $form_listtype3=$_POST['listtype3']; $form_listtype4=$_POST['listtype4']; $form_listtype5=$_POST['listtype5']; $form_email=$_GET['form_email']; ?>
Your email address:
Check the Career Postings you are interested in:
> Administrator Positions
> Support Postitions
> Faculty Positions
> Open Learning Faculty Member Positions
> Curriculum Development Positions
> Subscribe >Unsubscribe