summaryrefslogtreecommitdiff
path: root/api/addHistory.php
blob: e5dea25c7441441d467da041e95a173d00bfeb80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

header("X-Frame-Options: SAMEORIGIN");
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
global $songs; global $_PROFILE; global $history;

if (!isset($_GET["i"]) || !isset($songs[$_GET["i"]])) return;
$history[] = [
    "item" => $_GET["i"],
    "date" => date('c')
];

file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-history.json", json_encode($history));