Forum Moderators: coopster

Message Too Old, No Replies

how do i see if a folder exists on a web server

how do i see if a folder exists on a web server

         

MrGecko

4:13 pm on Sep 29, 2006 (gmt 0)

10+ Year Member



how do i see if a folder exists on a web server that is not the same server that i'm using to host the php file

barns101

4:30 pm on Sep 29, 2006 (gmt 0)

10+ Year Member



You could use fsockopen [php.net] and then read the header that is returned.

coopster

4:32 pm on Sep 29, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



On the same server or even the same network would be one thing, but I'm assuming you mean on another HTTP server altogether, correct? You aren't going to be able to if that is the case. Unless you have a script running on the other server that would check that information for you ... but that would be a big security issue.

coopster

4:42 pm on Sep 29, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



fsockopen would not always work. You are not going to be able to tell if the actual resource was a file or folder (Content Negotation may be used).

MrGecko

5:24 pm on Sep 29, 2006 (gmt 0)

10+ Year Member



now i'm using if file_exists