How do I show the user a previously uploaded file that is stored on the website's server (I am aware uploaded files should be stored on a different server) when I know the path? To explain; below in my code I have created a button inside an element and I am trying to get it to display the relevant file to the user by putting the relevant url in the element shows the user the file they need to see.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Total </title>
<link type="text/css" rel="stylesheet" href="course.css">
<script src="../jquery.js"></script>
<script src="../jquery-ui.js"></script>
</head>
<body>
<?php
if ($handle = opendir('../uploads'))
{
while (false !== ($entry = readdir($handle)))
{
if ($entry != "." && $entry != "..")
{
$real=realpath("../uploads/".$entry);
echo "<button class='files accordian'>$entry $real</button>
<div class='panel'>
<p>$real</p>";
echo '<a href="WHAT WOULD GO IN HERE?"><button class="current-file" name="sent" value="View-Current-File"><img class="view-file-img" src="../images/magnify.png">View Current File</button></a>';
}
}
}
?>
</body>
</html>