listing the files in the directory

From: Date: Fri, 24 May 2002 18:01:59 +0000
Subject: listing the files in the directory
Groups: php.general 
Request: Send a blank email to php-general+get-99116@lists.php.net to get a copy of this message
hi, i'm pretty new to php - i am trying to list/print a list of files and folders that are on my server: from my little knowledge i have got: <?php $dir = "http://mysite.com/"; $handle = opendir($dir); while (($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "- " . $file . "<br>"; } } ?> i keep getting errors - will this code list the files on my site? thanks in advance

« previous php.general (#99116) next »