D&S Hosting Support Forum: PHP Mailer Scripts Explotion Fix - D&S Hosting Support Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

PHP Mailer Scripts Explotion Fix

#1 User is offline   Dave Bateman 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 111
  • Joined: 20-December 02
  • Gender:Male
  • Location:UK

Post icon  Posted 08 December 2005 - 22:07

Nowadays there is an explotion on php mailler scripts and spammers can add their header - cc & bcc to your mail form and can send spam mails to mail address which can be added by them. Please use following codes in your php mailler scripts that can prevent anybody to add/change of header.

It should be at top of page (php codes) - it works for POST method

CODE
<?
$badStrings = array("Content-Type:",
"MIME-Version:",
"Content-Transfer-Encoding:",
"bcc:",
"cc:");
foreach($_POST as $k => $v){
foreach($badStrings as $v2){
if(strpos($v, $v2) !== false){
header("HTTP/1.0 403 Forbidden");
exit;
}
}
}
?>

Dave Bateman
Forum & Site Administrator
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users