Code snippet:
if (!($dirID = opendir($ACTUAL _STARTPATH . '/content/')) && $hasCookie) {
$html .= $font . '<font color=cc0000><l i>Could not open files in content
folder</li></font></font><p>';
} else if ($hasCookie) {
clearstatcache( ); // CLEAR THE STATUS CACHE FOR is_file() TO PROPERLY
DETERMINE FILE STATUS
$html .= $font . 'Contents: <p>';
while (($file = readdir($dirID) ) !== false) {
if (is_file($file) || !preg_match('/^\./', $file)) {
$html .= "\n<br><a href=/content/" . substr($file, strrpos('/', $file),
strlen($file)) .
'>' . substr($file, strrpos('/', $file), strlen($file)) .
"</a><p>\n";
}
}
}
where $ACTUAL_STARTPA TH is the actual path for each file. However, whenever
I try to check to see if a read file is an actual file and not either a
directory, '.' nor '..', it constantly skips every legitimate file! These
files have extensions of .html, .txt, .doc, .pdf, etc.
Is is_dir() then a failed PHP command?
Phil
if (!($dirID = opendir($ACTUAL _STARTPATH . '/content/')) && $hasCookie) {
$html .= $font . '<font color=cc0000><l i>Could not open files in content
folder</li></font></font><p>';
} else if ($hasCookie) {
clearstatcache( ); // CLEAR THE STATUS CACHE FOR is_file() TO PROPERLY
DETERMINE FILE STATUS
$html .= $font . 'Contents: <p>';
while (($file = readdir($dirID) ) !== false) {
if (is_file($file) || !preg_match('/^\./', $file)) {
$html .= "\n<br><a href=/content/" . substr($file, strrpos('/', $file),
strlen($file)) .
'>' . substr($file, strrpos('/', $file), strlen($file)) .
"</a><p>\n";
}
}
}
where $ACTUAL_STARTPA TH is the actual path for each file. However, whenever
I try to check to see if a read file is an actual file and not either a
directory, '.' nor '..', it constantly skips every legitimate file! These
files have extensions of .html, .txt, .doc, .pdf, etc.
Is is_dir() then a failed PHP command?
Phil
Comment