Session Variables
Posted: Tue Sep 25, 2007 2:25 am
Hi,
I am losing values in session variables after the successful transaction. I am using securetrading for payement gateway. What I want when the user transaction is successfull then I want to send user a confirmation email, right know when I try to access is session variables, to get user email address, the session variable returns nothing. Also I am trying to send HTML email but when I display this the HTML tags does not works I thing I need some header please help me in sorting these two issues.
Thanks
I am losing values in session variables after the successful transaction. I am using securetrading for payement gateway. What I want when the user transaction is successfull then I want to send user a confirmation email, right know when I try to access is session variables, to get user email address, the session variable returns nothing. Also I am trying to send HTML email but when I display this the HTML tags does not works I thing I need some header please help me in sorting these two issues.
Thanks
Code: Select all
if ($settings->PaymentPortal=='securetrading' && isset($_POST['stresult'])) {
include_once("inc/dbopen.php");
$query='';
$query=changefield($query,'PaymentStatus',$_POST['stresult']. '~'.$_POST['securityresponseaddress']. '~'.$_POST['securityresponsepostcode']. '~'.$_POST['securityresponsesecuritycode']. '~'.$_POST['stconfidence']. '~'.$_POST['securitymessage']);
$query=changefield($query,'PaymentAuthorisation',str_replace('AUTH CODE:','',$_POST['stauthcode']));
$query=changefield($query,'PaymentID',$_POST['streference']);
$query=changefield($query,'PaymentSecurityKey',$_POST['timestamp']);
$query = "UPDATE tblOrder ".$query." WHERE OrderID='".$_POST['orderref']."';";
mysql_query($query);
if (mysql_error()) {
#echo $query.'<br />'.mysql_error();
}
DownDateProducts($_POST['orderref']);
if ($_POST['stresult']=='1') {
$errormessage="Thank you for your payment, your order has been confirmed by email...";
##################################
//*********************************************************************************************
$body = '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Dear '.$userID .',<br />
<br />
Thank you for your order.<br />
<br />
<strong>Please keep a copy of this e-mail for your records.</strong><br />
<br />
<table width="700" border="0" cellpadding="0" cellspacing="0" class="border-collapse-12px">
<tr>
<td><strong class="text">Details of your order:</strong><br />
<br />
<table width="100%" border="1" cellpadding="5" cellspacing="0" bordercolor="#B7CFEE" class="border-collapse-10px">
<tr>
<td bgcolor="#FF66CC"><strong>Product Description: </strong></td>
<td width="70" align="center" bgcolor="#FF66CC"><strong>Qty</strong></td>
<td width="70" align="center" bgcolor="#FF66CC"><strong>Total Price </strong></td>
</tr>';
foreach ($cart->items as $id => $item) {
$body .= '<tr>
<td>'.$item->name.'</td>
<td align="center">'.$item->qty.'</td>
<td align="center">£'.number_format($item->extendedPrice(), 2,'.','').'</td>
</tr>';
}
$body .= ' </table>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border-collapse-12px">
<tr>
<td width="50%" valign="top"><strong>Your Delivery Details:</strong><br />
<br />
<table border="1" cellpadding="5" cellspacing="0" bordercolor="#B7CFEE" class="border-collapse-12px">
<tr>
<td width="207">'.$address.'</td>;
</tr>
</table></td>
<td width="50%" align="right" valign="top">
<table border="1" align="right" cellpadding="5" cellspacing="0" bordercolor="#B7CFEE" class="border-collapse-10px">
<tr>
<td width="70" bgcolor="#FF66CC">Carriage:</td>
<td width="70" align="center">£'.number_format($query, 2,'.','').'</td>
</tr>
<tr>
<td bgcolor="#FF66CC"><strong>Grand Total: </strong></td>
<td align="center"><strong>£'.number_format($cart->getTotalPrice()+$query, 2,'.','').'</strong></td>
</tr>
</table></td>
</tr>
</table>
<br></td>
</tr>
</table>
</body>
</html>';
//***********************************************************************************************
$to = $_SESSION['logged_user'];
$from= "Orders@perfumeforpleasure.com";
$subject = "P4P Order Confirmation !";
if (mail($to, $subject, $body, $from)) {
} else {
}