form to mail php project
DESCRIPTION
Form to Mail Php ProjectTRANSCRIPT
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more detai ls.
*****************************************************************/
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
$w4fver = "2.0.4";
$w4fx = strstr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));
if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"]) &&
($w4fx === FALSE)) {
$w4fMessage = "\n\n";
if (count($_GET) >0) {
reset($_GET);
while(list($key, $val) = each($_GET)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "$key: ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
$w4fMessage .= "$vala, ";
}
$w4fMessage .= "\n";
}
else {
$val = stripslashes($val);
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - \n"; }
else { $w4fMessage .= "$key: $val\n"; }
}
}
-
} // end while
}//end if
else {
reset($_POST);
while(list($key, $val) = each($_POST)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "$key: ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
$w4fMessage .= "$vala, ";
}
$w4fMessage .= "\n";
}
else {
$val = stripslashes($val);
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - \n"; }
else { $w4fMessage .= "$key: $val\n"; }
}
}
} // end while
}//end else
$w4fMessage .= "\n Sender IP: ".getenv('REMOTE_ADDR')."";
$w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
$name = preg_replace($w4f_what, "", $name);
$email = preg_replace($w4f_what, "", $email);
if (!$email) {$email = $MailToAddress;}
$mailHeader = "From: $name \r\n";
$mailHeader .= "Reply-To: $name \r\n";
$mailHeader .= "Message-ID: \r\n";
$mailHeader .= "MIME-Version: 1.0\r\n";
-
$mailHeader .= "Content-Type: multipart/alternative;";
$mailHeader .= " boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";
$mailHeader .= "X-Priority: 3\r\n";
$mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
$mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
$mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding:
quoted-printable\r\n\r\n";
$mailMessage .= strip_tags($w4fMessage)."\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/html; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= "$w4fMessage\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e -mail!";}
else { header("Location: ".$redirectURL); }
} else { echo "ILLEGAL EXECUTION DETECTED!";}
?>