Abusive Language Filter

Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.

  1. #1

    Default Abusive Language Filter

    Where do I substitute words in the code to make it "work?" Peter Hawkes
    submitted it March 2002 at [url]www.dwfaq.com/Snippets/[/url] Thanks in advance!:

    <?php
    $swear = array("abuse1", "abuse2", "abuse3", "abuse4", "abuse5", "abuse6");
    $text="Hello you abuse1 abuse2 how are you, abuse3 abuse4 abuse5 abuse6";
    echo "$text <br><br>";
    foreach($swear as $key=> $value){
    $text = str_replace("$value", "****", $text);
    }
    echo "$text";
    ?>

    slp2008 Guest

  2. Similar Questions and Discussions

    1. Dictionary language switches language during spellcheck
      During a spellcheck of a complete document, the language mysteriously switches from English USA (which in Canada isn't quite right, but that's...
    2. Language filter
      Hi All I have a website with a standard html form on it. Every now and then some jerk submits the form with some dirty words. This is then seen...
    3. #25051 [Opn->WFx]: translating between gettext language identifiers and 'Accept-Language' ones
      ID: 25051 Updated by: sniper@php.net Reported By: wouter at grep dot be -Status: Open +Status: Wont...
    4. #25051 [NEW]: translating between gettext language identifiers and 'Accept-Language' ones
      From: wouter at grep dot be Operating system: irrelevant PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug...
    5. How to prevent the language icon from disappearing and a language switching delay?
      What is wrong with my question since nobody answers it? How to improve the question? "Dmitriy Kopnichev" <kopn@hotbox.ru> wrote in message...
  3. #2

    Default Re: Abusive Language Filter

    you replace "abuse1", "abuse2", ... with your list of words and the
    $text line with your line to strip out words, like:

    $swear = array("cat","poo","dog","sex");
    $text = $_POST['comments'];

    or whatever field you're looking to filter instead of comments.

    Paul Davis
    [url]http://www.kaosweaver.com/[/url]
    Visit us for dozens of useful Dreamweaver Extensions.

    [url]http://www.communitymx.com/[/url]
    Partner at Community MX - Extend your knowledge

    slp2008 wrote:
    > Where do I substitute words in the code to make it "work?" Peter Hawkes
    > submitted it March 2002 at [url]www.dwfaq.com/Snippets/[/url] Thanks in advance!:
    >
    > <?php
    > $swear = array("abuse1", "abuse2", "abuse3", "abuse4", "abuse5", "abuse6");
    > $text="Hello you abuse1 abuse2 how are you, abuse3 abuse4 abuse5 abuse6";
    > echo "$text <br><br>";
    > foreach($swear as $key=> $value){
    > $text = str_replace("$value", "****", $text);
    > }
    > echo "$text";
    > ?>
    >
    Paul Davis Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139