Jump to content


Photo

spammed through the php form


  • Please log in to reply
8 replies to this topic

#1 musicalcat

musicalcat
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationSweden

Posted 21 June 2006 - 01:23 AM

I have a php page that process information entered in a form. I'm getting spam through that form. I've tried all kinds of php code to stop getting the spam. Now I'm wondering if it's possible to block special characters in the message field. Because in these spam messages I get links and forum codes like [/URL]. So I'd like to know if I can block characters like [ and ] in the message field with php code. Anyone know if that's possible? So if the $message field contains characters like [ and ] it won't be sent.
I hope somone understands what I'm trying to say.

Thanks in advance :)

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 21 June 2006 - 01:34 AM

[!--quoteo(post=386224:date=Jun 21 2006, 01:23 AM:name=tabby)--][div class=\'quotetop\']QUOTE(tabby @ Jun 21 2006, 01:23 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I have a php page that process information entered in a form. I'm getting spam through that form. I've tried all kinds of php code to stop getting the spam. Now I'm wondering if it's possible to block special characters in the message field. Because in these spam messages I get links and forum codes like [/URL]. So I'd like to know if I can block characters like [ and ] in the message field with php code. Anyone know if that's possible? So if the $message field contains characters like [ and ] it won't be sent.
I hope somone understands what I'm trying to say.

Thanks in advance :)
[/quote]

look up eregi ok.

YOUR have to look up the revelent code stucture ok.
<?

if(!erigi("^[url]\$",$message) {

echo" sorry you enter a bad charecter or name";

}
?>

Adding a captcha will let the user enter a random letter to slow the user down from
spaming but will not stop spaming.

Should really let only users that are logged in users use a form except a regesration form.

If the form is a form that a registered user keeps spamming band that user from posting posts band via there id.




Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 yonta

yonta
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 21 June 2006 - 01:34 AM

You could try to protect your form with a captcha image script. Just [a href=\"http://www.google.com/search?hl=en&q=php+captcha&btnG=Google+Search\" target=\"_blank\"]google it[/a].
do it, do it right, do it right now

#4 musicalcat

musicalcat
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationSweden

Posted 21 June 2006 - 01:41 AM

Thanks. I'll try that.

Take care!

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 21 June 2006 - 02:09 AM

[a href=\"http://www.imarc.net/blog/61/stopping_blog_comment_spam_with_php/\" target=\"_blank\"]http://www.imarc.net/blog/61/stopping_blog..._spam_with_php/[/a]

I added that and it stopped almost all of the 'messages' from losers peddling medical solutions to problems I don't have!
Legend has it that reading the manual never killed anyone.
My site

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 21 June 2006 - 02:33 AM

Heres my example if you want to use it ok




$message = $message;
$mess=array("@", "*", "$", "'", "{", "}", "<br>", "mysql", "connect", "</br>", "password", "money", "scam", ".", "com", "net", "uk");

foreach($mess as $val) 
{
$invalid = strpos($message, $val);
if($invalid===FALSE) { $count++; }

}

$array_count = count($mess, COUNT_RECURSIVE);
if($count==$array_count) { 



//INSERT DATABASE



}else { 

echo "<b>Your message contains illegal words / characters</b><br><br>Please try agin!<br><br><a href='url.php'>Please try agin</a>";
}

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#7 musicalcat

musicalcat
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationSweden

Posted 21 June 2006 - 03:08 AM

Thanks for your help.
I've tried both code suggestions. But I wasn't able to get it to work. I think this is too difficult for me.

#8 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 21 June 2006 - 03:13 AM

[!--quoteo(post=386263:date=Jun 21 2006, 03:08 AM:name=tabby)--][div class=\'quotetop\']QUOTE(tabby @ Jun 21 2006, 03:08 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Thanks for your help.
I've tried both code suggestions. But I wasn't able to get it to work. I think this is too difficult for me.
[/quote]

What is the name of the varable that holds the information that your checking?.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#9 musicalcat

musicalcat
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationSweden

Posted 21 June 2006 - 10:45 AM

I'm sorry. I'm lost again.

What is "varable"?

What php codes I've used to build the page that process the info is on this page:

[a href=\"http://www.tutorialtastic.co.uk/page/php_feedback_form_advanced\" target=\"_blank\"]http://www.tutorialtastic.co.uk/page/php_f...k_form_advanced[/a]

I've just changed the form action link, the number of input type fields and their names to fit my form fields.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users