WebServ/www/public/M6/egyTalk/api/getUserByUID.php

22 lines
494 B
PHP
Raw Normal View History

2024-09-27 09:10:29 +00:00
<?php
session_start();
$uid = $_GET['uid'];
$response['auth'] = false;
$response['userdata'] = null;
if (isset($_SESSION['uid'])) {
$response['auth'] = true;
include('../model/dbEgyTalk.php');
$db = new dbEgyTalk();
$response['userdata'] = $db->getUserByUID($uid);
}
// Behövs för session-cookies och anger att formatet är json
header('Access-Control-Allow-Credentials: true');
header('Content-Type: application/json');
echo json_encode($response, JSON_UNESCAPED_UNICODE);