summaryrefslogtreecommitdiff
path: root/api/addHistory.php
blob: 117fc066ff5448121538bb72cfad035bea7be5b4 (plain)
1
2
3
4
5
6
7
8
9
10
<?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[] = $_GET["i"];

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