// track.php - receives form then redirects to track-result.php with consignment in querystring // get the consignment from POST or GET $cons = ''; if (isset($_POST['Consignment']) && $_POST['Consignment'] !== '') { $cons = trim($_POST['Consignment']); } elseif (isset($_GET['Consignment']) && $_GET['Consignment'] !== '') { $cons = trim($_GET['Consignment']); } // if empty, go back to main page if ($cons === '') { header('Location: /index.php'); exit; } // redirect to track-result.php header("Location: /track-result.php?Consignment=" . urlencode($cons)); exit; ?>