Re: Form Data Filtering
| From: | K. Hayes | Date: | Sat, 16 Jun 2007 15:02:26 +0000 |
| Subject: | Re: Form Data Filtering | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257178@lists.php.net to get a copy of this message | ||
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 " <div>{$label_array[$field]}</div>"; //line 114
}
}
----- Original Message ----- From: "Stut" <stuttle@gmail.com>
To: "kvigor" <k3cheese@insightbb.com>
Cc: <php-general@lists.php.net>
Sent: Saturday, June 16, 2007 9:40 AM
Subject: Re: [PHP] Form Data Filtering
kvigor wrote:if (in_array(strtolower($value), $profanity)) {Which line is 114? I'm betting it's not the in_array line. -Stut$profanity[$field] = "bad";} on php.net I haven't seen any example on using strtolower w/ arrays. I tried this an I get the following output: Please REMOVE the profanity in the following fields. Immediately! Notice: Undefined offset: 0 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 Notice: Undefined offset: 1 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 Notice: Undefined offset: 2 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 Notice: Undefined offset: 3 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 ...etc. I also tried (in_array(strtolower($_POST[$value]), $profanity)) same result.