CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Check badwords before Validate forms

Print topic Send  topic

Author Message
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
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.