Viewing file: paypal.php (1.33 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include 'global.php';
require("./phpmailer/class.phpmailer.php");
$mail = new PHPMailer(); $mail->From = $email_from; $mail->AddAddress($_POST['Email']); $mail->AddBcc($email_from); $mail->IsHTML(true);
$data = [ 'cmd' => '_xclick', 'business' => $paypal_email, 'lc' => 'IT', 'currency_code' => 'EUR', 'button_subtype' => 'services', 'no_note' => 1, 'no_shipping' => 2, 'rm' => 1, 'return' => $paypal_urlreturn_OK, 'cancel_return' => $paypal_urlreturn_KO, 'bn' => 'PP-BuyNowBF:btn_paynowCC_LG.gif:NonHosted', 'item_name' => $_POST['Causale'], 'amount' => $_POST['Importo'] ];
$body = '';
foreach($_POST as $k => $v) if($k != 'trattamento') $body .= $k . ' : ' . $v .'<br>';
$paypal_link = $paypal_url.'?';
foreach($data as $k => $v) $paypal_link .= $k.'='.urlencode($v).'&';
$body .= '<br><br> Pagamento con PayPal, <a href="'.$paypal_link.'">clicca qui</a><br><br><br>';
//echo $body;
//$mail->WordWrap = 50;
$mail->Subject = $email_subject; $mail->Body = $email_pre.$body.$email_post;
$mail->Send();
/* if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } */
echo "<br><center>...Connessione al sito Paypal, attendere prego...</center>"; header("Location: " . $paypal_link . "");
|