You are here: Re: [PHP] FileExists? « PHP « IT news, forums, messages
Re: [PHP] FileExists?

Posted by "Richard Lynch" on 10/03/36 11:31

On Mon, November 7, 2005 1:45 pm, Gustav Wiberg wrote:
> File_exists doesn't seem to work with URLs that point to another
> domain.
> What to use?
>
> $x = fopen(http://www.stammis.com/getstart.php);

There are no quotes on that URL... I'd be surprised if this doesn't
error out, but maybe you just need E_ALL to see the E_NOTICE you've
been ignoring.

At any rate, you need quotes, whether you realize it or not.

> if file_exists($x) ....

$x, at this point, is either FALSE because fopen() failed, or an open
file handle.

file_exists() expects the path to a file name (a string).

Perhaps you meant:
file_exists("http://www.example.com");

http://php.net/file_exists specifically links to the kinds of
stream-wrappers that are and aren't supported. Did you read that?

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация