Jump to content

Archived

This topic is now archived and is closed to further replies.

musicalcat

spammed through the php form

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
[!--quoteo(post=386224:date=Jun 21 2006, 01:23 AM:name=tabby)--][div class=\'quotetop\']QUOTE(tabby @ Jun 21 2006, 01:23 AM) [snapback]386224[/snapback][/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.
[code]
<?

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

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

}
?>
[/code]

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.



Share this post


Link to post
Share on other sites
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].

Share this post


Link to post
Share on other sites
[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!

Share this post


Link to post
Share on other sites
Heres my example if you want to use it ok

[code]



$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>";
}
[/code]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--quoteo(post=386263:date=Jun 21 2006, 03:08 AM:name=tabby)--][div class=\'quotetop\']QUOTE(tabby @ Jun 21 2006, 03:08 AM) [snapback]386263[/snapback][/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?.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

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.