Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Banned
    Join Date
    Jul 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MY codes not working

    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);
    }
    ?>

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    <?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.
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •