emulatorjs-GameLibrary/profile_get.php
Ramaerel 10185de76a The final update
I've been working on this for a few months now. I will no longer be updating it personally. This is a full revamp with all the features I wanted to add.
2025-03-06 10:18:00 +10:00

30 lines
712 B
PHP

<?php
/**
* Profile data endpoint
* This file handles getting profile data for editing
*/
session_start();
include 'functions.php';
// Check if we're getting a profile
if (isset($_GET['action']) && $_GET['action'] == 'get' && isset($_GET['profile_id'])) {
$profileId = $_GET['profile_id'];
// Get the profile data
$profile = getProfileById($profileId);
// Return JSON response
header('Content-Type: application/json');
if ($profile) {
echo json_encode($profile);
} else {
http_response_code(404);
echo json_encode(['error' => 'Profile not found']);
}
exit;
}
// Redirect to index if accessed directly
header('Location: index.php');