I'm trying to see if a file exists on a remote server,
in a password protected area.  In the fopen
documentation there is the following note:

02-Feb-2000 07:39 
To check if a file exists using http or ftp use the

$fp =
if ($fp)
{ print"The file exists!"; }
{ print"The file does not exist"; }

Note: The "@" in front of fopen suppresses the error
output of
the function.

I hope this clears up some confusion.

When I use this code with a URL like:
http://user:[EMAIL PROTECTED]/data/i37/20020513.trn

 it returns "The file exists"  whether it does or
doesn't.  If I change the domain name to one that
doesn't exist, then it returns "The file does not
exist", as I would expect.  

Using an echo of $fp, I see $fp is set to "Resource id
#1" whenever the script sets $fp as TRUE.  What's that

Seems there is a problem with having the user name and
pass in the URL and using fopen.  Any idea what's
going on and more importantly, any way around it?

Thanks for your time.  I look forward to your reply.



Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to