Jump to content

SPAM being sent


CanMan2004

Recommended Posts

Hi all

A whiile ago I setup a website which has a registeration form on it, it has been fine for a while, but recently, there has been 2 times when someone is managing to hyjack the form and sending SPAM out through the form. After the first time, we added a image check, which made the user have to enter a code embeded in the image before they could continue, but this doesnt seem to have worked.

What can I do to prevent this?

Thanks

Mark
Link to comment
https://forums.phpfreaks.com/topic/30349-spam-being-sent/
Share on other sites

Add a function to check if the email being submitted is a hijacking email, you cna use these functions:

/**
* Check single-line inputs:
* Returns false if text contains newline character
*/
function has_no_newlines($text)
{
  return preg_match("/(%0A|%0D|\\n+|\\r+)/i", $text) == 0;
}

/**
* Check multi-line inputs:
* Returns false if text contains newline followed by
* email-header specific string
*/
function has_no_emailheaders($text)
{
  return preg_match("/(%0A|%0D|\\n+|\\r+)(content-type:|to:|cc:|bcc:)/i", $text) == 0;
}

Then check each of the fields that should only be single lines with the first function, and check any multiline fields with the second function to make sure it contains no email headers.
Link to comment
https://forums.phpfreaks.com/topic/30349-spam-being-sent/#findComment-139913
Share on other sites

Archived

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

×
×
  • 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.