All pastes #349355 Raw Edit

Noor

public php v1 · immutable
·published 2007-02-10 18:51 UTC
rendered paste body
<?if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_name'])){	$charset = "windows-1256";	$to = "dr@humood.com";	$subject = encode(stripslashes($HTTP_POST_VARS['sender_subject']),$charset);	$body = encode(stripslashes($HTTP_POST_VARS['sender_message']),$charset);	$header  .= 'MIME-Version: 1.0' . "\n";	$header .= "Content-type: text/plain; charset=windows-1256" . "\n";	$header .= "Content-transfer-encoding: base64" . "\n";	$header = "From: " . encode($HTTP_POST_VARS['sender_name'],$charset) . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";	$header .= "Reply-To: " . encode($HTTP_POST_VARS['sender_name'],$charset) . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";	$header .= "X-Mailer: PHP/" . phpversion() . "\n";	$header .= "X-Priority: 1";	if(@mail($to, $subject, $body, $header))	{		echo "output=sent";	} else {		echo "output=error";	}} else {	echo "output=error";}function encode($in_str, $charset) {   $out_str = $in_str;   if ($out_str && $charset) {       // define start delimimter, end delimiter and spacer       $end = "?=";       $start = "=?" . $charset . "?B?";       $spacer = $end . "\r\n " . $start;       // determine length of encoded text within chunks       // and ensure length is even       $length = 75 - strlen($start) - strlen($end);       $length = floor($length/2) * 2;       // encode the string and split it into chunks       // with spacers after each chunk       $out_str = base64_encode($out_str);       $out_str = chunk_split($out_str, $length, $spacer);       // remove trailing spacer and       // add start and end delimiters       $spacer = preg_quote($spacer);       $out_str = preg_replace("/" . $spacer . "$/", "", $out_str);       $out_str = $start . $out_str . $end;   }   return $out_str;} ?>