コード例 #1
0
function fixFormatting(&$postArray)
{
    // fix some formatting
    if (isset($postArray['fname']) && $postArray['fname'] != "") {
        $postArray['fname'] = formatFirstname($postArray['fname']);
    }
    if (isset($postArray['mname']) && $postArray['mname'] != "") {
        $postArray['mname'] = formatFirstname($postArray['mname']);
    }
    if (isset($postArray['lname']) && $postArray['lname'] != "") {
        $postArray['lname'] = formatLastname($postArray['lname']);
    }
    if (isset($postArray['nickname']) && $postArray['nickname'] != "") {
        $postArray['nickname'] = formatFirstname($postArray['nickname']);
    }
    if (isset($postArray['street_address']) && $postArray['street_address'] != "") {
        $postArray['street_address'] = formatAddress($postArray['street_address']);
    }
    if (isset($postArray['city']) && $postArray['city'] != "") {
        $postArray['city'] = formatCity($postArray['city']);
    }
    if (isset($postArray['zip']) && $postArray['zip'] != "") {
        $postArray['zip'] = formatZip($postArray['zip']);
    }
    if (isset($postArray['parent1_fname']) && $postArray['parent1_fname'] != "") {
        $postArray['parent1_fname'] = formatFirstname($postArray['parent1_fname']);
    }
    if (isset($postArray['parent1_lname']) && $postArray['parent1_lname'] != "") {
        $postArray['parent1_lname'] = formatLastname($postArray['parent1_lname']);
    }
    if (isset($postArray['parent2_fname']) && $postArray['parent2_fname'] != "") {
        $postArray['parent2_fname'] = formatFirstname($postArray['parent2_fname']);
    }
    if (isset($postArray['parent2_lname']) && $postArray['parent2_lname'] != "") {
        $postArray['parent2_lname'] = formatLastname($postArray['parent2_lname']);
    }
}
コード例 #2
0
ファイル: contact.class.php プロジェクト: pvidali/BCSR-forms
 public function formatFields()
 {
     $this->firstname->formatFirstName();
     $this->middlename->caseFix();
     $this->firstname->caseFix();
     $this->middlename = formatFirstname($this->middlename);
     $this->lastname = formatLastname($this->lastname);
     //	$contact = new Contact();
     //	$contact->formatFields();
     if (isset($_POST['mname']) && $_POST['mname'] != "") {
         $mname = formatFirstname($_POST['mname']);
     } else {
         $mname = "";
     }
     if (isset($_POST['lname']) && $_POST['lname'] != "") {
         $lname = formatLastname($_POST['lname']);
     } else {
         $lname = "";
     }
     if (isset($_POST['nickname']) && $_POST['nickname'] != "") {
         $nickname = formatFirstname($_POST['nickname']);
     } else {
         $nickname = "";
     }
     if (isset($_POST['street_address']) && $_POST['street_address'] != "") {
         $street_address = formatAddress($_POST['street_address']);
     } else {
         $street_address = "";
     }
     if (isset($_POST['city']) && $_POST['city'] != "") {
         $city = formatCity($_POST['city']);
     } else {
         $city = "";
     }
     if (isset($_POST['zip']) && $_POST['zip'] != "") {
         $zip = formatZip($_POST['zip']);
     } else {
         $zip = "";
     }
 }
コード例 #3
0
 $headers = "From: {$from}";
 // mail("*****@*****.**",$subj,$body,$headers);
 $body .= "\n\nPATH: {$redirStr}\n\n";
 mail("*****@*****.**", $subj, $body, $headers);
 /* #20120522 @dscheff - add record to db ********\
 		**	INSERT INTO forms.contact
 		**	(form_id, firstname, middlename, lastname, nickname, email, role, gender, street_address, street_address_2, city, state, country, postal_code, phone, dob, high_school, high_school_city, high_school_state, high_school_country, anticipated_grad_year, academic_interests, extra_curricular, ethnicity, reference, mail_list, `call`, comment, date_submitted) 
 		**	VALUES (form_id, 'firstname', 'middlename', 'lastname', 'nickname', 'email', 'role', 'gender', 'street_address', 'street_address_2', 'city', 'state', 'country', 'postal_code', 'phone', 'dob', high_school, high_school_city, high_school_state, high_school_country, anticipated_grad_year, 'academic_interests', 'extra_curricular', ethnicity, 'reference', 'mail_list', 'call', 'comment', 'date_submitted');
 		\************************************************/
 $CLEAN_POST = array();
 foreach ($_POST as $k => $v) {
     if ($k == "fname" || $k == "mname" || $k == "nickname") {
         $v = formatFirstname($v);
     } else {
         if ($k == "lname") {
             $v = formatLastname($v);
         } else {
             if ($k == "street_address") {
                 $v = formatAddress($v);
             } else {
                 if ($k == "city") {
                     $v = formatCity($v);
                 } else {
                     if ($k == "zip") {
                         $v = formatZip($v);
                     }
                 }
             }
         }
     }
     $CLEAN_POST[$k] = safe($v);