<?php
require 'functions.php';

$index = $_GET['index'];
$data = loadData();

$filename = $data[$index]['filename'];
unlink('uploads/' . $filename);
array_splice($data, $index, 1);
saveData($data);

header('Location: index.php');
?>
