function __construct($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,$academic_interests,$ethnicity,$reference,$mail_list,$call,$comment,$date_submitted,$vr_email,$vr_campaign,$vr_term $this->firstname = caseFix($firstname); $this->middlename = caseFix($middlename); $this->lastname = caseFix($lastname); $this->nickname = caseFix($nickname); $this->email = $email; $this->role = $role; $this->gender = $gender; $this->street_address = caseFix($street_address); $this->street_address_2 = caseFix($street_address_2); $this->city = caseFix($city); $this->state = $state; $this->country = $country; $this->postal_code = formatZip($postal_code); $this->phone = $phone; $this->dob = $dob; $this->high_school = $high_school; $this->high_school_city = $high_school_city; $this->high_school_state = $high_school_state; $this->high_school_country = $high_school_country; $this->anticipated_grad_year = $anticipated_grad_year; /* $this->academic_interests = $academic_interests; $this->extra_curricular = $extra_curricular; $this->ethnicity = $ethnicity; $this->reference = $reference; $this->mail_list = $mail_list; $this->call = $call; $this->comment = $comment; $this->date_submitted = $date_submitted; $this->vr_email = $vr_email; $this->vr_campaign = $vr_campaign; $this->vr_term = $vr_term; */ }
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 = ""; } }
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']); } }
$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); echo "PRE-CLEAN {$k} : " . $v . "<br />"; echo "CLEAN {$k} : " . $CLEAN_POST[$k] . "<br /><br />"; } exit; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">