Reply to Re: [suspicious - maybe spam] [PHP] How to access remote files with php?

Your name:

Reply:


Posted by Richard Lynch on 01/19/05 18:54

Sephiroth wrote:
> Hi all,
>
> How to access remote files with php?
> For ex:
> $sFile = "http://www.php.net/123.txt";
> if (file_exists($sFile)) {
> $hFile = fopen($sFile);
> ...
> fclose($hFile);
> }

At the risk of being accused of copying whatshisname...

"Yes."

:-)

You're pretty much written the code in its most simple form the way it
should be, and it should work as-is.

You'd want to add in some error-checking code so your application does
something reasonable when the file isn't found, or the network connection
flakes out, or...

PS file_exists() may only work for URLs in recent versions of PHP... Read
the manual to find out which versions.

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

[Back to original 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

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