PHP to get files files from a directory

Discussion in 'PHP' started by MrPJH, Jan 16, 2010.

  1. #1
    Any help is it possible
    echo the files exists in a specific directory using $PATH = URL

    how to read or open directory from website

    i checked it on my own server works well but when i put a url (domain.com/dir/) it do not works
    help if you know

    Thanks
     
    MrPJH, Jan 16, 2010 IP
  2. astkboy2008

    astkboy2008 Peon

    Messages:
    211
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use dir scan in php
     
    astkboy2008, Jan 16, 2010 IP
  3. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #3
    Sky AK47, Jan 16, 2010 IP
  4. MrPJH

    MrPJH Well-Known Member

    Messages:
    1,066
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    155
    #4
    handle = opendir("i want url here"))

    
    <?php
    if ($handle = opendir("i want url here")) {
     while (($file = readdir($handle)) !== false) {
       echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
     }
     closedir($dh);
    }
    ?> 
    
    Code (markup):
     
    MrPJH, Jan 16, 2010 IP
  5. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #5
    Umh..what do you want to do exactly? You should use the full path.
    Eg. /home/username/domain.com/dir/.
     
    Sky AK47, Jan 16, 2010 IP
  6. astkboy2008

    astkboy2008 Peon

    Messages:
    211
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    its imposiple to see from url
    lol
    if any one can see the dir files from the url
    lol
    the world will die
     
    astkboy2008, Jan 16, 2010 IP
  7. MrPJH

    MrPJH Well-Known Member

    Messages:
    1,066
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    155
    #7
    the world will not die untill .htaccess and PHP.INI works

    and will not die who know how to disable fopen
    http://www.kingkoopa.com/001A/clr.php (but CURL works)

    will die who upload there products of high value $$ to websites like
    http://www.americaint.com/d/download/ :D

    and will die who do not know how to disable directory browsing like
    http://www.chipdouro.com.pt/Infor/


    CURL works for what i was looking for

    
    <?php
    $dir = fopen("your URL here/dir/","r");
    print_r(scandir("$dir"));
    ?> 
    
    Code (markup):
    and scandir too as mentioned above

    i just started webmasters marketplace forum and i needed this to fight against spammers and for arbitration system

    there is nothing imposable
     
    Last edited: Jan 17, 2010
    MrPJH, Jan 17, 2010 IP