News-website/privateInfo.php
2020-09-16 10:00:31 +02:00

11 lines
No EOL
444 B
PHP

<?php
require_once realpath(__DIR__ . '/vendor/autoload.php');
use Dotenv\Dotenv;
$dotend = Dotenv::createImmutable(__DIR__);
$dotend->load();
if($_SERVER['REQUEST_METHOD'] !== 'POST') return;
if(isset($_POST['images'])) echo $_ENV['IMAGE_API_KEY'];
else if(isset($_POST['user'])) echo $_ENV['USER_LOCATION_API_KEY'];
else if(isset($_POST['weather'])) echo $_ENV['WEATHER_API_KEY'];
else if(isset($_POST['news'])) echo $_ENV['NEWS_API_KEY'];