PDA

View Full Version : MY codes not working



1234
Jul 14th, 2002, 07:43 AM
I try to do with this codes,but I can't find my mistake.
Please tell me my mistake
opendir(???)what should I write(???)
I don't know what to put.

Where should I change ?

Please tell me


<?php
if ($handle = opendir('c:\itohideo\ito2.php')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handle);
}
?>

Íkii
Jul 14th, 2002, 01:08 PM
<?php
$dirname = 'c:/itohideo/';
if(is_dir($dirname)) {
$handle = opendir($dirname);
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handle);
}
?>

You were trying to open ito2.php as a directory.