Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple filter but ..?

    hi

    i need a quick basic help..it about filtering message for the words..spma words to be exact.. i have email form builtin php on my swebsite now robots come and fill the forms with word "poker" in the From or SUbject or MEssage part or email and send as junk to my hidden email account. i want this things to be filtered out using a EXTERNAL FILTERWORDS.TXT file.

    so all the email message that it $MESG is checked of it contains any word listen in FILTERWORDS.TXT and if it does the visitor is redireted to www.google.com ( example) if it doesnt then the mail is sent and thankyou.php is continued..


    any one can help me with this filter words script with external file containg banned words ?

    thanks
    Move on....

  • #2
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    PHP Code:
    if(filter($MESG)){
    //send
    }
    else{
    header("Location: http://www.google.com");
    }

    function 
    filter($message){
    $lines file("FILTERWORDS.txt");
    foreach(
    $lines as $line){
    if(
    strpos($messagertrim($line))){
    return 
    false;
    }

    }
    return 
    true;

    Last edited by NancyJ; 09-07-2005 at 01:54 PM.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nopes

    it didnt work gave "PARSE error" on running..

    dunno y.. some1?
    Move on....

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i am trying to implement the check for bad words on this page

    http://www.pindiplus.com/kashif/about/index.php

    tc
    Move on....

  • #5
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    post edited with corrections - I missed the brackets round the if statements (been working in asp all day)

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I want to add a suggestion here as well.
    You're problem is that bots are submitting your forms correct? You may want to look into making use of php's GD Library extensions to create a random code. Users can view and type this in, however bots cannot. This could then be used to direct them to a new page, something like 'Not all fields completed'. This is by no means the easiest route to do this with, but I'd recommend it if available for registrations and whatnots. Considering as well that I only allow emails sent from registered users, I've never had a problem with a bot, as they can never become registered users.
    Just a suggestion though...


  •  

    Posting Permissions

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