Fandelem
03-27-2001, 02:47 PM
i'm wondering why it isn't recognizing directories from filenames.. i've tried both is_file() and is_dir()
has anyone gotten this working? here is my code:
// (this prints out files *and directories for some reason)
while($filename = readdir($dirhandle)) {
if ( !is_dir($filename) ) {
print("<option value=\"$filename\">$filename</option>");
}
}
}
and here is my first attempt that i thought would work (but doesn't)
while($filename = readdir($dirhandle)) {
if ( !is_dir($filename) ) {
if ( !is_file($filename) ) {
print("<option value=\"$filename\">$filename (directory)</option>");
}
else {
print("<option value=\"$filename\">$filename</option>");
}
}
}
any insight would be great :D :D
~kyle
has anyone gotten this working? here is my code:
// (this prints out files *and directories for some reason)
while($filename = readdir($dirhandle)) {
if ( !is_dir($filename) ) {
print("<option value=\"$filename\">$filename</option>");
}
}
}
and here is my first attempt that i thought would work (but doesn't)
while($filename = readdir($dirhandle)) {
if ( !is_dir($filename) ) {
if ( !is_file($filename) ) {
print("<option value=\"$filename\">$filename (directory)</option>");
}
else {
print("<option value=\"$filename\">$filename</option>");
}
}
}
any insight would be great :D :D
~kyle