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);
?>Moderator: General Moderators
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);
?>Code: Select all
<?php
$dirpath = "/home/user456/public_html/test/upload";
$dh = opendir($dirpath);
while (false !== ($file = readdir($dh))) {
$content=file_get_contents($dirpath . $file);
echo "$content<br><br>";
}
closedir($dh);
?>Code: Select all
<?
$dirpath = "/home/user456/public_html/test/upload";
$dh = opendir($dirpath);
while (false !== ($file = readdir($dh))) {
//
if (!is_dir("$dirpath/$file")) {
$filename="$dirpath/$file";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
//
echo "$contents<br><br>";
}
}
closedir($dh);
?>