Ok I made the following change to the code which will now redirects the output with multiple results to another page.
This code is in my header file:
PHP Code:
$order_number=$_POST['order_number'];
$track_rs = $db->Execute("SELECT tracking_number FROM fulfill_tracking WHERE order_number = " . (int)$order_number);
if ($track_rs ->RecordCount() == 1) {
$track_num = $track_rs ->fields['tracking_number'];
header('Location: http://customurl.com/' . $track_num);
} elseif ($track_rs ->RecordCount() > 0) {
$_SESSION['order_number'] = $order_number;
zen_redirect(zen_href_link(FILENAME_TRACKING, 'action=trackingInfo'));
} else {
$messageStack->add('tracking', ENTRY_ORDER_NUMBER_ERROR3);
}
This code is in my templates file:
PHP Code:
<?php
if (isset($_GET['action']) && ($_GET['action'] == 'trackingInfo')) {
?>
<div class="mainContent trackingInfo"></div>
<?php
$order_number = $_SESSION['order_number'];
$track_rs = $db->Execute("SELECT tracking_number FROM fulfill_tracking WHERE order_number = " . (int)$order_number);
if ($track_rs ->RecordCount() > 0) {
$track_num = array();
while(!$track_rs->EOF) {
$track_num[] = $track_rs ->fields['tracking_number'];
$track_rs->MoveNext();
}
echo '<p class="trackingInfoBoxes">This order shipped in ' . sizeof($track_num). ' box' .(sizeof($track_num) != 1 ? 'es' : '') . ':</p>';
echo "\n";
foreach ($track_num as $key => $val) {
echo '<p class="trackingInfoPackages">Package ' . ($key+1) . ': <a href="http://customurl.com/' . $val . '">Click to Track</a></p>';
echo "\n";
}
}
?>
It works not sure if there is a better way of doing it though. Thanks again for the help!