File not echo-ing what it should be

Hello,
So the following is a script that should echo the name of the files in the directory http://www.the-irf.com/ , but when I run the script of my server here (http://www.the-irf.com/echoFile.php) all I see is a blank page.

Does anyone know why this is occurring and how to fix it?


<?php
$dir = "http://www.the-irf.com/files/";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            echo "filename: $file";
        }
        closedir($dh);
    }
}
?>

I would appreciate any and all help!

Thanks in Advance & Best Regards,
Team

This may spark an idea
http://www.electrictoolbox.com/php-glob-find-files/

That is another way to do something similar, but I am trying to echo the names of the files not the paths to them.

$dir = “http://www.the-irf.com/files/”;

SB

$dir = “/path/on/your/server/websites/irf.com/files/”;

OR a path relative to the folder this script is called from:

$dir = “…/files/”;

OR same folder:

$dir = “./”;

ah, so i can’t use a url then?