Here is the code in case any other learner needs it.
echo "<a href=scriptName.php?id=$i>".$fList[$i]."</a><br>";
scriptName.php is the name of the file the code is in.
this should create a link a with GET ID on your script get the ID using GET and then download it.
Got the help i needed from http://www.phphelp.com