Merge pull request #456 from Struart88/patch-2
[FlightAirMap.git] / redirect.php
blob5a0a11dc75cfbe01f36e88a770c9d318e6096c3e
1 <?php
2 require_once('require/class.Connection.php');
3 require_once('require/class.Spotter.php');
4 require_once('require/class.Language.php');
5 $Spotter = new Spotter();
6 if ($_GET['flightaware_id'] != "")
8 $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
9 $spotter_id = $Spotter->getSpotterIDBasedOnFlightAwareID($flightaware_id);
10 if ($spotter_id != "")
12 header('Location: '.$globalURL.'/flightid/'.$spotter_id);
13 } else {
14 if ($globalURL == '') {
15 header('Location: /');
16 } else {
17 header('Location: '.$globalURL);