file_put_contents problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

file_put_contents problem

Post 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...
Post Reply