FX Rhaps
|
| Posted: 07/28/2002, 8:24 PM |
|
Hello,
I am working on a form. I would like to prevent the user to post a message
in the Text Area with badwords.
Is there a Validation Rule or Validation Text to write in the Data
properties of the fields or in the Events of the form ?
Or should I better use a Table in my Access DB with all the badwords to
prevent ? And so change the SQL query.
If anyone have a example.
Thanks for help.
Rhaps
|
|
|
 |
donb
|
| Posted: 07/29/2002, 12:08 PM |
|
Just a thought, but you might be better off doing this on the database side,
as a trigger or something. Put the logic to scan the content for words
maintained in a table. Then you know that someone can't subvert your rules.
Probably faster, too.
"FX Rhaps" <fxrhapsody@hotmail.com> wrote in message
news:ai2ch1$2v3$1@news.codecharge.com...
> Hello,
> I am working on a form. I would like to prevent the user to post a message
> in the Text Area with badwords.
> Is there a Validation Rule or Validation Text to write in the Data
> properties of the fields or in the Events of the form ?
> Or should I better use a Table in my Access DB with all the badwords to
> prevent ? And so change the SQL query.
>
> If anyone have a example.
>
> Thanks for help.
> Rhaps
>
>
|
|
|
 |
Jeroen Steggink
|
| Posted: 07/30/2002, 12:18 AM |
|
Try this:
function badwords($message) {
$badwords =
array("wanker","bastard","fuck","fcuk","shit","cunt","whore","hore","twat","
bitch","prick","cock");
foreach($badwords as $badword) {
$stars = str_repeat("*", strlen($badword));
$message = str_replace($badword, $stars, $message);
}
return $message;
}
"FX Rhaps" <fxrhapsody@hotmail.com> wrote in message
news:ai2ch1$2v3$1@news.codecharge.com...
> Hello,
> I am working on a form. I would like to prevent the user to post a message
> in the Text Area with badwords.
> Is there a Validation Rule or Validation Text to write in the Data
> properties of the fields or in the Events of the form ?
> Or should I better use a Table in my Access DB with all the badwords to
> prevent ? And so change the SQL query.
>
> If anyone have a example.
>
> Thanks for help.
> Rhaps
>
>
|
|
|
 |
|