Re: Form Data Filtering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK,

I'm still getting "Undefined Index" error. Please view code below.

foreach($_POST as $field => $value)
{
     if ($value == "")
     {
      $blank_array[$field] = "blank";
     }

     if($field == "conZip" || $field == "schZip")
     {
           if (!ereg("^[0-9]{5}(\-[0-9]{4})?$",$_POST[$field]))
          {
           $format[$field] = "bad";
          }
     }


    $profanity = array("fuck", "shit", "whore", "hoe", "bullshit", "ass", 
"asshole","piss","bitch","bastard","bastard","motherfucker",
    "pussy","cunt","slut","hell","goddamn","minx","skank","tit","wanker","dick","twat","whore");

     if ($value == in_array(strtolower($_POST[$value]),$profanity))
     {
      $profanity[$field] = "bad";
     }


}

if(@sizeof($profanity) > 0)
 {
  echo "<div class='ermess1'><br />Please <b>REMOVE</b> the profanity in the 
following fields. Immediately!</div>";

  foreach($profanity as $field => $value)
  {
   echo "&nbsp;&nbsp;<div>{$label_array[$field]}</div>";
  }
 } 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux