<?php
session_start();
include("serverConnect.php");
include("functions.php");

$displayError = true;

if (isset($_GET['resource']) && isset($_GET['shortestRoute'])){
    //TODO : check everything
    
    $resource = intval($_GET['resource']);
    $shortestRoute = intval($_GET['shortestRoute']) / 100;
    
    $_SESSION['tradeResource'] = $resource;
    $_SESSION['tradeShortestRoute'] = $shortestRoute;
        
    $displayError = false;
}

if (!$displayError){
	header("Location:trade.php");
	exit;
}
else {
    echo "FAIL";
}
?>