Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
by fabrizzio » Mon Dec 30, 2002 4:51 pm
does anybody knows how can i read the directory contents with a remote addr? I mean read all the files placed at:"http://www.server.com/direc"
thanks
fabrizzio
-

fabrizzio
- New php-forum User

-
- Posts: 10
- Joined: Fri Dec 13, 2002 2:22 pm
by Joan Garnet » Tue Dec 31, 2002 6:34 am
If you want to show all contents of a directory just leve it without
index page, then you'll be able to do this -->
http://www.server.com/directory/
and you'll see a list of all contents in that dir.
If you want to scan a directory of yours with php use this:
- Code: Select all
if ($dir = @opendir("./mydir_from_this_diectory")) {
while (($file = readdir($dir)) !== false) {
echo "$file<br>";
}
closedir($dir);
}
bye!
-

Joan Garnet
- Moderator

-
- Posts: 387
- Joined: Sat Aug 03, 2002 2:56 am
- Location: Mars
-
Return to PHP coding => General
Who is online
Users browsing this forum: Bing [Bot], danfields and 2 guests