I have a script that I found out in the internet and I tried alot of thinks but I cant find what's wrong.
The script does a list of what's in a folder and then it makes links to that files but it links them wrong, it should link them to admin/upload/FILE
and it just links them to href="FILE"

PHP Code:

if ($handle opendir('admin/upload/')) {
   while (
false !== ($file readdir($handle)))
          if (
$file != "." && $file != "..")
$thelist .= '<a href="'.$file.'" target="_blank">'.$file.'</a><br>';
<P>Llista de archius:</p>
Thanks in advance!