News-website/privateInfo.php

12 lines
519 B
PHP
Raw Permalink Normal View History

<?php
require_once realpath(__DIR__ . '/vendor/autoload.php');
use Dotenv\Dotenv;
$dotend = Dotenv::createImmutable(__DIR__);
$dotend->load();
if($_SERVER['REQUEST_METHOD'] !== 'POST') return;
2020-09-16 08:00:31 +00:00
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'];
else if(isset($_POST['google_client_id'])) echo $_ENV['GOOGLE_CLIENT_ID'];