$nameErr
"; } elseif (empty($_POST["LastName"])) { $nameErr = "Please enter your LAST NAME."; // echo "$nameErr
"; } else { // then check for forbidden characters if (strpbrk($_POST["FirstName"],"/\;$%#|!?.1234567890") != FALSE) { $nameErr = "<-- *Forbidden character or string found. Please enter a valid FIRST NAME.".substr_replace($nameErr,'',0,4)."
"; } else { if (strpbrk($_POST["LastName"],"/\;$%#|!?.1234567890") != FALSE) { $nameErr = "<-- *Forbidden character or string found. Please enter a valid LAST NAME.".substr_replace($nameErr,'',0,4)."
"; } } $_POST["FirstName"] = filterName($_POST["FirstName"]); $_POST["LastName"] = filterName($_POST["LastName"]); } // Validate and sanitize sport: not blank, no forbidden characters if(empty($_POST["Sport1"])){ $sport1Err = "Please enter your PRIMARY SPORT."; echo "$sport1Err
"; } else { if (strpbrk($_POST["Sport1"],"/\;$%#.|!1234567890") != FALSE) { $sport1Err = "*Forbidden characters found. Please enter a valid SPORT."; echo "$sport1Err
"; } $_POST["Sport1"] = filterSport1($_POST["Sport1"]); } // Validate and sanitize birthdate(s): no forbidden characters if(!empty($_POST["BirthDate"])){ if (strpbrk($_POST["BirthDate"],";$^:~%()?*@#.|!".chr(34)) != FALSE) { $errors["athletebirthErr"] = $athletebirthErr = "<-- *Forbidden characters found. Please enter a valid BIRTH DATE.".substr_replace($errors["athletebirthErr"],'',0,4)."
"; } $_POST["BirthDate"] = filter_var(trim($_POST["BirthDate"]), FILTER_SANITIZE_STRING); $_POST["BirthDate"] = str_replace([";", chr(34), "$", "%", "(", ")", "#", "?", "^", "&", "<", ">", "*", "|", ":", "?", "!", "'", "."], "", $_POST["BirthDate"]); } if(!empty($_POST["I1_DOB"])){ if (strpbrk($_POST["I1_DOB"],";$^%()?*@#.|!".chr(34)) != FALSE) { $errors["insureddobErr"] = $insureddobErr = "<-- *Forbidden characters found. Please enter a valid DATE OF BIRTH.".substr_replace($errors["insureddobErr"],'',0,4)."
"; } $_POST["I1_DOB"] = filter_var(trim($_POST["I1_DOB"]), FILTER_SANITIZE_STRING); $_POST["I1_DOB"] = str_replace([";", chr(34), "$", "%", "(", ")", "#", "?", "^", ":", "&", "<", ">", "*", "|", "?", "!", "'", "."], "", $_POST["I1_DOB"]); } // Validate and sanitize address text fields if(!empty($_POST["A1_Address1"])){ if (strpbrk($_POST["A1_Address1"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["localaddressErr"] = $localaddressErr = "<-- *Forbidden characters found. Please enter a valid LOCAL ADDRESS.".substr_replace($errors["localaddressErr"],'',0,4)."
"; // echo "".substr_replace($localaddressErr,'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["A1_Address1"] = filterString($_POST["A1_Address1"],$forbid_arr); } if(!empty($_POST["A2_Address1"])){ if (strpbrk($_POST["A2_Address1"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["homeaddressErr"] = $homeaddressErr = "<-- *Forbidden characters found. Please enter a valid HOME ADDRESS.".substr_replace($errors["homeaddressErr"],'',0,4)."
"; // echo "".substr_replace($homeaddressErr,'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["A2_Address1"] = filterString($_POST["A2_Address1"],$forbid_arr); } if(!empty($_POST["C2_Address1"])){ if (strpbrk($_POST["C2_Address1"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["parentaddressErr"] = $parentaddressErr = "<-- *Forbidden characters found. Please enter a valid PARENT/GUARDIAN ADDRESS.".substr_replace($errors["parentaddressErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["C2_Address1"] = filterString($_POST["C2_Address1"],$forbid_arr); } if(!empty($_POST["A1_City"])){ if (strpbrk($_POST["A1_City"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["localcityErr"] = $localcityErr = "<-- *Forbidden characters found in LOCAL CITY name - use letters, spaces, dashes, apostrophes only.".substr_replace($errors["localcityErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["A1_City"] = filterString($_POST["A1_City"],$forbid_arr); } if(!empty($_POST["A2_City"])){ if (strpbrk($_POST["A2_City"],"$%?/\*^[]{}@|".chr(34)) != FALSE) { $errors["homecityErr"] = $homecityErr = "<-- *Forbidden characters found in HOME CITY name - use letters, spaces, dashes, apostrophes only.".substr_replace($errors["homecityErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["A2_City"] = filterString($_POST["A2_City"],$forbid_arr); } if(!empty($_POST["C2_City"])){ if (strpbrk($_POST["C2_City"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["parentcityErr"] = $parentcityErr = "<-- *Forbidden characters found in PARENT/GUARDIAN CITY - use letters, spaces, dashes, apostrophes only.".substr_replace($errors["parentcityErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["C2_City"] = filterString($_POST["C2_City"],$forbid_arr); } if(!empty($_POST["A1_State"])){ if (strpbrk($_POST["A1_State"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["localstateErr"] = $localstateErr = "<-- *Forbidden characters found in LOCAL STATE name - use letters, spaces, dashes, apostrophes only.".substr_replace($errors["localstateErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "^", "*", "&", "#", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["A1_State"] = filterString($_POST["A1_State"],$forbid_arr); } if(!empty($_POST["A2_State"])){ if (strpbrk($_POST["A2_State"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["homestateErr"] = $homestateErr = "<-- *Forbidden characters found in HOME STATE name - use letters, spaces, dashes, apostrophes only.".substr_replace($errors["homestateErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "&", "#", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["A2_State"] = filterString($_POST["A2_State"],$forbid_arr); } if(!empty($_POST["C2_State"])){ if (strpbrk($_POST["C2_State"],"$%?/\^*[]{}@|".chr(34)) != FALSE) { $errors["parentstateErr"] = $parentstateErr = "<-- *Forbidden characters found PARENT/GUARDIAN STATE name - use letters, spaces, dashes, apostrophes only.".substr_replace($errors["parentstateErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "&", "#", "[", "]", "{", "}", "@", "<", ">", "|"); $_POST["C2_State"] = filterString($_POST["C2_State"],$forbid_arr); } if(!empty($_POST["A1_ZipCode"])){ if (strpbrk($_POST["A1_ZipCode"],"$%?/\^*@|".chr(34)) != FALSE) { $errors["localzipErr"] = $localzipErr = "<-- *Forbidden characters found LOCAL ZIP/POST code - use numbers, letters, spaces, dash only.".substr_replace($errors["localzipErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "@", "<", ">", "|"); $_POST["A1_ZipCode"] = filterString($_POST["A1_ZipCode"],$forbid_arr); } if(!empty($_POST["A2_ZipCode"])){ if (strpbrk($_POST["A2_ZipCode"],"$%?/\^*@|".chr(34)) != FALSE) { $errors["homezipErr"] = $homezipErr = "<-- *Forbidden characters found in HOME ZIP/POST code - use numbers, letters, spaces, dash only.".substr_replace($errors["homezipErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "@", "<", ">", "|"); $_POST["A2_ZipCode"] = filterString($_POST["A2_ZipCode"],$forbid_arr); } if(!empty($_POST["C2_ZipCode"])){ if (strpbrk($_POST["C2_ZipCode"],"$%?/\^*@|".chr(34)) != FALSE) { $errors["parentzipErr"] = $parentzipErr = "<-- *Forbidden characters found in PARENT/GUARDIAN ZIP/POST code - use numbers, letters, spaces, dash only.".substr_replace($errors["parentzipErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "@", "<", ">", "|"); $_POST["C2_ZipCode"] = filterString($_POST["C2_ZipCode"],$forbid_arr); } if(!empty($_POST["A1_Country"])){ if (strpbrk($_POST["A1_Country"],"$%?/\^*@|1234567890".chr(34)) != FALSE) { $errors["localcountryErr"] = $localcountryErr = "<-- *Forbidden characters found - use letters, spaces, dash only.".substr_replace($errors["localcountryErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "&", "#", "@", "<", ">", "|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); $_POST["A1_Country"] = filterString($_POST["A1_Country"],$forbid_arr); } if(!empty($_POST["C2_Country"])){ if (strpbrk($_POST["C2_Country"],"$%?/\^*@|1234567890".chr(34)) != FALSE) { $errors["parentcountryErr"] = $parentcountryErr = "<-- *Forbidden characters found - use letters, spaces, dash only.".substr_replace($errors["parentcountryErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "&", "#", "@", "<", ">", "|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); $_POST["C2_Country"] = filterString($_POST["C2_Country"],$forbid_arr); } // Telephone number validation and sanitization if(!empty($_POST["A1_CellPhone"])){ if (preg_match("/[^0-9-).+( ]/", $_POST["A1_CellPhone"])) { $errors["athletecellErr"] = $athletecellErr = "<-- *Forbidden characters found - use numbers, parenthesis, spaces, periods, and dash only.".substr_replace($errors["athletecellErr"],'',0,4)."
"; } $_POST["A1_CellPhone"] = filter_var(trim($_POST["A1_CellPhone"]), FILTER_SANITIZE_STRING); $_POST["A1_CellPhone"] = preg_replace("/[^0-9-).+( ]/", "", $_POST["A1_CellPhone"]); } if(!empty($_POST["C2_HomePhone"])){ if (preg_match("/[^0-9-).+( ]/", $_POST["C2_HomePhone"])) { $errors["parenthomephoneErr"] = $parenthomephoneErr = "<-- *Forbidden characters found - use numbers, parenthesis, spaces, periods, and dash only.".substr_replace($errors["parenthomephoneErr"],'',0,4)."
"; } $_POST["C2_HomePhone"] = filter_var(trim($_POST["C2_HomePhone"]), FILTER_SANITIZE_STRING); $_POST["C2_HomePhone"] = preg_replace("/[^0-9-).+( ]/", "", $_POST["C2_HomePhone"]); } if(!empty($_POST["C2_CellPhone"])){ if (preg_match("/[^0-9-).+( ]/", $_POST["C2_CellPhone"])) { $errors["parentcellErr"] = $parentcellErr = "<-- *Forbidden characters found - use numbers, parenthesis, spaces, periods, and dash only.".substr_replace($errors["parentcellErr"],'',0,4)."
"; } $_POST["C2_CellPhone"] = filter_var(trim($_POST["C2_CellPhone"]), FILTER_SANITIZE_STRING); $_POST["C2_CellPhone"] = preg_replace("/[^0-9-).+( ]/", "", $_POST["C2_CellPhone"]); } if(!empty($_POST["C1_CellPhone"])){ if (preg_match("/[^0-9-).+( ]/", $_POST["C1_CellPhone"])) { $errors["emergcontactcellErr"] = $emergcontactcellErr = "<-- *Forbidden characters found - use numbers, parenthesis, spaces, periods, and dash only.".substr_replace($errors["emergcontactcellErr"],'',0,4)."
"; } $_POST["C1_CellPhone"] = filter_var(trim($_POST["C1_CellPhone"]), FILTER_SANITIZE_STRING); $_POST["C1_CellPhone"] = preg_replace("/[^0-9-).+( ]/", "", $_POST["C1_CellPhone"]); } if(!empty($_POST["C1_WorkPhone"])){ if (preg_match("/[^0-9-).+( ]/", $_POST["C1_WorkPhone"])) { $errors["emergworkphoneErr"] = $emergworkphoneErr = "<-- *Forbidden characters found - use numbers, parenthesis, spaces, periods, and dash only.".substr_replace($errors["emergworkphoneErr"],'',0,4)."
"; } $_POST["C1_WorkPhone"] = filter_var(trim($_POST["C1_WorkPhone"]), FILTER_SANITIZE_STRING); $_POST["C1_WorkPhone"] = preg_replace("/[^0-9-).+( ]/", "", $_POST["C1_WorkPhone"]); } if(!empty($_POST["I1_PolicyHolder_Phone"])){ if (preg_match("/[^0-9-).+( ]/", $_POST["I1_PolicyHolder_Phone"])) { $errors["insuredphoneErr"] = $insuredphoneErr = "<-- *Forbidden characters found - use numbers, parenthesis, spaces, periods, and dash only.".substr_replace($errors["insuredphoneErr"],'',0,4)."
"; } $_POST["I1_PolicyHolder_Phone"] = filter_var(trim($_POST["I1_PolicyHolder_Phone"]), FILTER_SANITIZE_STRING); $_POST["I1_PolicyHolder_Phone"] = preg_replace("/[^0-9-).+( ]/", "", $_POST["I1_PolicyHolder_Phone"]); } if(!empty($_POST["I1_Phone"])){ if (preg_match("/[^0-9-).+( ]/", $_POST["I1_Phone"])) { $errors["insurphoneErr"] = $insurphoneErr = "<-- *Forbidden characters found - use numbers, parenthesis, spaces, periods, and dash only.".substr_replace($errors["insurphoneErr"],'',0,4)."
"; } $_POST["I1_Phone"] = filter_var(trim($_POST["I1_Phone"]), FILTER_SANITIZE_STRING); $_POST["I1_Phone"] = preg_replace("/[^0-9-).+( ]/", "", $_POST["I1_Phone"]); } // Validate and sanitize email fields if(!empty($_POST["A1_eMail"])){ if(!filter_var($_POST["A1_eMail"], FILTER_VALIDATE_EMAIL)) { $errors["athleteeMailErr"] = $athleteeMailErr = "<-- *eMail address does not appear to be properly formatted: ".$_POST["A1_eMail"]."".substr_replace($errors["athleteeMailErr"],'',0,4)."
"; // Strip out forbidden characters $forbid_arr = array(chr(34), "<", ">", ")", ",", ":", ";", "]", "(", chr(92), "["); $_POST["A1_eMail"] = str_replace($forbid_arr, "", $_POST["A1_eMail"]); } // Sanitize e-mail address $_POST["A1_eMail"] = filter_var(trim($_POST["A1_eMail"]), FILTER_SANITIZE_EMAIL); } if(!empty($_POST["C2_eMail"])){ if(!filter_var($_POST["C2_eMail"], FILTER_VALIDATE_EMAIL)) { $errors["parenteMailErr"] = $parenteMailErr = "<-- *eMail address does not appear to be properly formatted: ".$_POST["C2_eMail"]."".substr_replace($errors["parenteMailErr"],'',0,4)."
"; // Strip out forbidden characters $forbid_arr = array(chr(34), "<", ">", ")", ",", ":", ";", "]", "(", chr(92), "["); $_POST["C2_eMail"] = str_replace($forbid_arr, "", $_POST["C2_eMail"]); } // Sanitize e-mail address $_POST["C2_eMail"] = filter_var(trim($_POST["C2_eMail"]), FILTER_SANITIZE_EMAIL); } // general string validation and sanitization if(!empty($_POST["SSN"])){ if (strpbrk($_POST["SSN"],"$%?/\^*:;&[](){}#@=+~,.|".chr(34).chr(32)) != FALSE) { $errors["ssnErr"] = $ssnErr = "<-- *Forbidden characters found - use numbers, dash only.".substr_replace($errors["ssnErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), chr(32), "%", "?", chr(92), chr(47), "*", "~", "&", "#", "@", "}", "{", "<", ";", "=", "+", "(", ")", "]", "[", ":", ".", ",", ">", "|"); $_POST["SSN"] = filterString($_POST["SSN"],$forbid_arr); } if(!empty($_POST["I1_InsuredID"])){ if (strpbrk($_POST["I1_InsuredID"],"$%?/\^*:;&[](){}#@=+~,.|".chr(34).chr(32)) != FALSE) { $errors["insuredssnErr"] = $insuredssnErr = "<-- *Forbidden characters found - use numbers, dash only.".substr_replace($errors["insuredssnErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), chr(32), "%", "?", chr(92), chr(47), "*", "~", "&", "#", "@", "}", "{", "<", ";", "=", "+", "(", ")", "]", "[", ":", ".", ",", ">", "|"); $_POST["I1_InsuredID"] = filterString($_POST["I1_InsuredID"],$forbid_arr); } if(!empty($_POST["C2_FirstName"])){ if (strpbrk($_POST["C2_FirstName"],"$%?/\*:;&[](){}#@=+~,.|1234567890".chr(34)) != FALSE) { $errors["parentnameErr"] = $parentnameErr = "<-- *Forbidden characters found - use letters, spaces, dash only.".substr_replace($errors["parentnameErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "~", "&", "#", "@", "}", "{", "<", ";", "=", "+", "(", ")", "]", "[", ":", ".", ",", ">", "|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); $_POST["C2_FirstName"] = filterString($_POST["C2_FirstName"],$forbid_arr); } if(!empty($_POST["C1_FirstName"])){ if (strpbrk($_POST["C1_FirstName"],"$%?/\*:;&[](){}#@=+~,.|1234567890".chr(34)) != FALSE) { $errors["emergcontactnameErr"] = $emergcontactnameErr = "<-- *Forbidden characters found - use letters, spaces, dash only.".substr_replace($errors["emergcontactnameErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "~", "&", "#", "@", "}", "{", "<", ";", "=", "+", "(", ")", "]", "[", ":", ".", ",", ">", "|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); $_POST["C1_FirstName"] = filterString($_POST["C1_FirstName"],$forbid_arr); } if(!empty($_POST["C1_Relationship"])){ if (strpbrk($_POST["C1_Relationship"],"$%?/\^*:;&[](){}#@=+~,.|1234567890".chr(34)) != FALSE) { $errors["emergcontactrelationErr"] = $emergcontactrelationErr = "<-- *Forbidden characters found - use letters, spaces, dash only.".substr_replace($errors["emergcontactrelationErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "~", "&", "#", "@", "}", "{", "<", ";", "=", "+", "(", ")", "]", "[", ":", ".", ",", ">", "|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); $_POST["C1_Relationship"] = filterString($_POST["C1_Relationship"],$forbid_arr); } if(!empty($_POST["I1_PolicyHolder_First"])){ if (strpbrk($_POST["I1_PolicyHolder_First"],"$%?/\*:;&[](){}#@=+~,.|1234567890".chr(34)) != FALSE) { $errors["insurednameErr"] = $insurednameErr = "<-- *Forbidden characters found - use letters, spaces, dash only.".substr_replace($errors["insurednameErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "~", "&", "#", "@", "}", "{", "<", ";", "=", "+", "(", ")", "]", "[", ":", ".", ",", ">", "|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); $_POST["I1_PolicyHolder_First"] = filterString($_POST["I1_PolicyHolder_First"],$forbid_arr); } if(!empty($_POST["insured_relation"])){ if (strpbrk($_POST["insured_relation"],"$%?/\^*:;&[](){}#@=+~,.|1234567890".chr(34)) != FALSE) { $errors["insuredrelationErr"] = $insuredrelationErr = "<-- *Forbidden characters found - use letters, spaces, dash only.".substr_replace($errors["insuredrelationErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", "?", chr(92), chr(47), "*", "~", "&", "#", "@", "}", "{", "<", ";", "=", "+", "(", ")", "]", "[", ":", ".", ",", ">", "|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); $_POST["insured_relation"] = filterString($_POST["insured_relation"],$forbid_arr); } if(!empty($_POST["insured_employer"])){ if (strpbrk($_POST["insured_employer"],"%/\;[]{}~|") != FALSE) { $errors["insuredemployErr"] = $insuredemployErr = "<-- *Forbidden characters found: ".$_POST["insured_employer"]."".substr_replace($errors["insuredemployErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "~", "}", "{", "<", "]", "[", ";", ">", "|"); $_POST["insured_employer"] = filterString($_POST["insured_employer"],$forbid_arr); } if(!empty($_POST["insured_employer_address"])){ if (strpbrk($_POST["insured_employer_address"],"$%\*[]{}@=+|".chr(34)) != FALSE) { $errors["insuredemployaddressErr"] = $insuredemployaddressErr = "<-- *Forbidden characters found: ".$_POST["insured_employer_address"]; echo "".substr_replace($errors["insuredemployaddressErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", chr(92), "*", "@", "<", "=", "+", "]", "[", ">", "|"); $_POST["insured_employer_address"] = filterString($_POST["insured_employer_address"],$forbid_arr); } if(!empty($_POST["I1_Company"])){ if (strpbrk($_POST["I1_Company"],"%/\;[]{}~|") != FALSE) { $errors["insurcoErr"] = $insurcoErr = "<-- *Forbidden characters found: ".$_POST["I1_Company"]."".substr_replace($errors["insurcoErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "~", "}", "{", "<", "]", "[", ";", ">", "|"); $_POST["I1_Company"] = filterString($_POST["I1_Company"],$forbid_arr); } if(!empty($_POST["I1_Address1"])){ if (strpbrk($_POST["I1_Address1"],"$%\*[]{}@=+|".chr(34)) != FALSE) { $errors["insuraddressErr"] = $insuraddressErr = "<-- *Forbidden characters found: ".$_POST["I1_Address1"]."".substr_replace($errors["insuraddressErr"],'',0,4)."
"; } $forbid_arr = array("$", chr(34), "%", chr(92), "*", "@", "<", "=", "+", "]", "[", ">", "|"); $_POST["I1_Address1"] = filterString($_POST["I1_Address1"],$forbid_arr); } if(!empty($_POST["I1_Group"])){ if (strpbrk($_POST["I1_Group"],"%\^=;[]{}~|".chr(34)) != FALSE) { $errors["groupErr"] = $groupErr = "<-- *Forbidden characters found: ".$_POST["I1_Group"]."".substr_replace($errors["groupErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "~", "}", "{", "^", "=", "<", "]", "[", ";", ">", "|"); $_POST["I1_Group"] = filterString($_POST["I1_Group"],$forbid_arr); } if(!empty($_POST["I1_Policy"])){ if (strpbrk($_POST["I1_Policy"],"%\^=;[]{}~|".chr(34)) != FALSE) { $errors["policyErr"] = $policyErr = "<-- *Forbidden characters found: ".$_POST["I1_Policy"]."".substr_replace($errors["policyErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "~", "}", "{", "^", "=", "<", "]", "[", ";", ">", "|"); $_POST["I1_Policy"] = filterString($_POST["I1_Policy"],$forbid_arr); } if(!empty($_POST["I1_Plan"])){ if (strpbrk($_POST["I1_Plan"],"%\^=;[]{}~|".chr(34)) != FALSE) { $errors["planErr"] = $planErr = "<-- *Forbidden characters found: ".$_POST["I1_Plan"]."".substr_replace($errors["planErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "~", "}", "{", "^", "=", "<", "]", "[", ";", ">", "|"); $_POST["I1_Plan"] = filterString($_POST["I1_Plan"],$forbid_arr); } if(!empty($_POST["I1_ID"])){ if (strpbrk($_POST["I1_ID"],"%\^=;[]{}~|".chr(34)) != FALSE) { $errors["idErr"] = $idErr = "<-- *Forbidden characters found: ".$_POST["I1_ID"]."".substr_replace($errors["idErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "~", "}", "{", "^", "=", "<", "]", "[", ";", ">", "|"); $_POST["I1_ID"] = filterString($_POST["I1_ID"],$forbid_arr); } // insert strings from checkboxes (if selected) if(isset($_POST["insur_type_hmo"])) { if(empty($_POST["I1_Type"])) { $_POST["I1_Type"] .= $_POST["insur_type_hmo"]; } else { $_POST["I1_Type"] .= ", ".$_POST["insur_type_hmo"]; } } if(isset($_POST["insur_type_ppo"])) { if(empty($_POST["insur_type_hmo"]) && empty($_POST["I1_Type"])) { $_POST["I1_Type"] .= $_POST["insur_type_ppo"]; } else { $_POST["I1_Type"] .= ", ".$_POST["insur_type_ppo"]; } } if(isset($_POST["insur_type_pos"])) { if(empty($_POST["insur_type_hmo"]) && empty($_POST["insur_type_ppo"]) && empty($_POST["I1_Type"])) { $_POST["I1_Type"] .= $_POST["insur_type_pos"]; } else { $_POST["I1_Type"] .= ", ".$_POST["insur_type_pos"]; } } if(isset($_POST["insur_type_medicaid"])) { if(empty($_POST["insur_type_hmo"]) && empty($_POST["I1_Type"]) && empty($_POST["insur_type_ppo"]) && empty($_POST["insur_type_pos"])) { $_POST["I1_Type"] .= $_POST["insur_type_medicaid"]; } else { $_POST["I1_Type"] .= ", ".$_POST["insur_type_medicaid"]; } } if(!empty($_POST["I1_Type"])){ if (strpbrk($_POST["I1_Type"],"%/\;[]{}~|") != FALSE) { $errors["insurotherErr"] = $insurotherErr = "<-- *Forbidden characters found: ".$_POST["I1_Type"]."".substr_replace($errors["insurotherErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "~", "}", "{", "<", "]", "[", ";", ">", "|"); $_POST["I1_Type"] = filterString($_POST["I1_Type"],$forbid_arr); } if(!empty($_POST["Notes"])){ if (strpbrk($_POST["Notes"],"[]{}|") != FALSE) { $errors["commentErr"] = $commentErr = "<-- *Forbidden characters found: ".$_POST["Notes"]; echo "".substr_replace($errors["commentErr"],'',0,4)."
"; } $forbid_arr = array( "%", chr(92), "}", "{", "<", "]", "[", ">", "|"); $_POST["Notes"] = filterString($_POST["Notes"],$forbid_arr); } // validate and sanitize URL if(!empty($_POST["I1_Address2"])){ if(!filter_var($_POST["I1_Address2"], FILTER_VALIDATE_URL)) { $errors["URLErr"] = $URLErr = "<-- *Website URL does not appear to be properly formatted: ".$_POST["I1_Address2"]."".substr_replace($errors["URLErr"],'',0,4)."
"; // Strip out forbidden characters $forbid_arr = array(chr(34), "<", ">", ")", ",", ":", ";", "]", "(", "["); $_POST["insurance_company_website"] = str_replace($forbid_arr, "", $_POST["I1_Address2"]); } // Sanitize e-mail address $_POST["I1_Address2"] = filter_var(trim($_POST["I1_Address2"]), FILTER_SANITIZE_URL); } } $input_array = $_POST; // foreach ($input_array as $value) { foreach($input_array as $key=>$value) { if(!empty($value)) { // echo "$value