Hi!
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:
///////////////////////////////////////////////
[EMAIL PROTECTED]
02-Feb-2000 07:39
To check if a file exists using http or ftp use the
following:
$fp =
@fopen("http://www.someurl.com/testfile.php3","r");
if ($fp)
{ print"The file exists!"; }
else
{ 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
mean?
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.
peace,
-tad.
http://www.mediatitan.com
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php