The trouble i am having is the return.php page seems to be accessing the database to quickly before the database is updated by paypals IPN
i have added a sleep of 5 sec but this doesnt work. if i refresh the page this works.
i have made the if statements versatile so if the incorrect message is displayed it wont show an incorrect message. however now the session isnt showing even though it is started. can anyone tell me if there is a way around this?
Code: Select all
<?php
session_start();
sleep(5);//Added sleep to give database time to update from IPN
$colname_rsReturn = "-1";
if (isset($_SESSION['OrderID'])) {
$colname_rsReturn = $_SESSION['OrderID'];
}
mysql_select_db($database_beauSS15, $beauSS15);
$query_rsReturn = sprintf("SELECT * FROM beau_orders WHERE OrderID = %s", GetSQLValueString($colname_rsReturn, "int"));
$rsReturn = mysql_query($query_rsReturn, $beauSS15) or die(mysql_error());
$row_rsReturn = mysql_fetch_assoc($rsReturn);
$totalRows_rsReturn = mysql_num_rows($rsReturn);
?>
Code: Select all
<?php if ($row_rsReturn['TransactResult'] == 'Completed'):?>
Your orderID <?php echo $_SESSION['OrderID']; ?>
thanks for shopping please email us with any questions
<?php endif ; ?>
<?php if ($row_rsReturn['TransactResult'] != 'Completed'):?>
You will recieve an email shortly from PAYPAL regarding your order (<?php echo $_SESSION['OrderID']; ?>).If you do have any questions or enquires please don't hesitate to contact us.
<?php endif ; ?>
Undifined index: OrderID in........
this to me says the session is not starting
thanks