PHP help. I need a script modified?

  • Thread starter Thread starter skymodog
  • Start date Start date
S

skymodog

Guest
I have a php script that displays the contents of a directory. The problem is, it's REALLY messy. Can you make it so it displays the contents each on a seperate line and makes them links?

Here's the script:
<?php
$dir = "name_of_directory";
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}

sort($files);

print_r($files);

rsort($files);

print_r($files);


?>
I'm getting this error:
Parse error: syntax error, unexpected ';' in /home/colts/public_html/test.php on line 21

On this line:
echo($file_name . "<br \> \n"; // remove <br> if not on a web page
 
Back
Top