21 lines
671 B
PHP
21 lines
671 B
PHP
<?php
|
|
|
|
session_start();
|
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
|
|
$dotenv = Dotenv\Dotenv::createImmutable($_SERVER['DOCUMENT_ROOT']); // dir containing .env
|
|
$dotenv->load();
|
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/auto/connection.php';
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/auto/user.php';
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
$contentType = $_SERVER['CONTENT_TYPE'] ?? '';
|
|
if (str_contains($contentType, 'application/json') || str_contains($contentType, 'text/plain')) {
|
|
$input = json_decode(file_get_contents("php://input"), true);
|
|
if (is_array($input)) {
|
|
$_POST = [...$_POST, ...$input];
|
|
}
|
|
}
|
|
}
|