Page 1 of 1

file_put_contents problem

Posted: Mon Nov 12, 2007 3:21 pm
by Sindarin

Code: Select all

<?

$dirpath = "/home/user456/public_html/test/upload";
$dh = opendir($dirpath);
while (false !== ($file = readdir($dh))) {
$content=file_get_contents($file);
echo "$content<br><br>";
}
closedir($dh);

?>
I am trying to list the contents of some text files in my upload directory, but I must be doing something wrong with file_get_contents...