Jump to content

Peter37

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Peter37's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a lot for your attempt to help me. I followed your advices, but filter still does not work. There are no error messages now, but maybe something is wrong with the code. I am sending you the beginnig part of my .php file with your codes, and I hope that it will be easier to find the mistake. <html> <? $badwords = file("badwords.txt"); foreach($badwords as $key => $value){ if (eregi($value, $contents)){ echo "Error, no comments were submitted. You may not have any rude words in your comment!"; die(); } { $to = "1994@hotmail.com"; $subject="Comment"; $from="Dan's Website"; if($contents != "") { //send mail - $subject & $contents come from surfer input mail($to, $subject, $contents, $from_header); // redirect back to url visitor came from } else { print("<HTML><BODY>Error, no comments were submitted!"); print("</BODY></HTML>"); } } } $contents.="\n Firstname:"; $contents.=$Contact_FirstName; $contents.="\n Lastname:"; $contents.=$Contact_LastName; $contents.="\n City:"; $contents.=$Contact_City; $contents.="\n Country:"; $contents.=$Contact_State; $contents.="\n URL:"; $contents.=$Contact_ZipCode; $contents.="\n Email:"; $contents.=$Contact_Email; $contents.="\n Comments:"; $contents.=$Comments; ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  2. Thank you very much for your code. I got next error message,” Parse error: parse error, unexpected '<' in /homepages/41/d182358255/htdocs/comment/confirm.php on line 52” I am not sure if I created correctly file “badwords.text”  Is it correct format,” sex, Viagra, adult”? [quote author=php_joe link=topic=112822.msg458101#msg458101 date=1161883256] Make a list of words to add to the filter. Then put this at the top of the php file: [code]$badwords = file("badwords.txt"); foreach($badwords as $key => $value){ if (eregi($value, $contents)){ echo "Error, no comments were submitte.You may not have any rude words in your comment!"; die(); }else{ $to = "1994@hotmail.com"; $subject="Comment"; $from="Dan's Website"; if($contents != "") {    //send mail - $subject & $contents come from surfer input    mail($to, $subject, $contents, $from_header);    // redirect back to url visitor came from     }   else {    print("<HTML><BODY>Error, no comments were submitted!");    print("</BODY></HTML>"); } } } [/code] I'm sure there's a better way then cycling through each bad word, maybe someone else can offer it. :) Though I think that you shouldn't tell the spammers that you're filtering their messages or they will just alter the words slightly (like using a one instead of a lower case "L", or putting a period in the wo.rd). Joe [/quote]
  3. To Whom It May Concern: If it is possible, could you help me to edit this part of my .php file. I am getting too much spam from the form on the Website. I need to add filter. The mail has to be sent if it does not contain words “Viagra, sex, erotica.” Otherwise, the sender have to get next error message,” Error, no comments were submitte.You may not have any rude words in your comment!” $to = "1994@hotmail.com"; $subject="Comment"; $from="Dan's Website"; if($contents != "") {   //send mail - $subject & $contents come from surfer input   mail($to, $subject, $contents, $from_header);   // redirect back to url visitor came from   }   else {   print("<HTML><BODY>Error, no comments were submitted!");   print("</BODY></HTML>"); } ?> Thank you in advance for your response and help. Sincerely, Peter
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.