<?php $direct = "folder"; if ($dir = @opendir($direct)) while ($file = readdir($dir)) echo "<a href=$direct/$file>$file</a><br>"; ?>