clientID, "clientsecret" => clientsecret), JSON_UNESCAPED_UNICODE); $responses = ioAPIv2('/v2/authorization', $data,''); //Decode Payload if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = '400';} $clientsecret = $responses['token']; // Output error variable $error = ''; //error reporting if (debug){ ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL); } //Age consent session if (isset($_POST['age_consent_allow'])){$_SESSION["age_consent"] = 1;} // Banner if (isset($_POST['banner_stay'])){$_SESSION["banner"] = 1;} if (isset($_POST['banner_move'])){ session_destroy(); header('location: '.banner_link.''); die(); } // Define all the routes for all pages $url = routes([ '/' => 'home.php', 'test' => 'test.php', '/about' => 'custom/pages/about.php', '/about_morval' => 'custom/pages/about_morval.php', '/product/{id}' => 'product.php', '/product/{id}/{option_id}' => 'product.php', '/products' => 'products.php', '/products/{category}' => 'products.php', '/products/{category}/{sort}' => 'products.php', '/products/{p}/{category}/{sort}' => 'products.php', '/myaccount' => 'myaccount.php', '/myaccount/{activation_key}' => 'myaccount.php', '/myaccount/{tab}' => 'myaccount.php', '/download/{id}' => 'download.php', '/cart' => 'cart.php', '/cart/{remove}' => 'cart.php', '/checkout' => 'checkout.php', '/placeorder' => 'placeorder.php', '/placeorder/{order_id}' => 'placeorder.php', '/search/{query}' => 'search.php', '/logout' => 'logout.php', '/termsandconditions'=> 'custom/pages/termsandconditions.php', '/termsandconditions/{download}'=> 'custom/pages/termsandconditions.php', '/faq'=> 'custom/pages/faq.php', '/privacy'=> 'custom/pages/privacy.php', '/privacy/{download}'=> 'custom/pages/privacy.php', '/instructions-for-use' => 'custom/pages/faq.php' ]); // Check if route exists if ($url) { include $url; } else { // Page is set to home (home.php) by default, so when the visitor visits that will be the page they see. $page = isset($_GET['page']) && file_exists($_GET['page'] . '.php') ? $_GET['page'] : 'home'; // Include the requested page include $page . '.php'; } ?>