You are here: Re: [PHP] fopen and redirects « PHP « IT news, forums, messages
Re: [PHP] fopen and redirects

Posted by Richard Lynch on 02/24/05 18:43

Warren Vail wrote:
> I am using fopen with a url to open a remote file (read only of course).
> The url I am providing results in a redirect and the fopen seems to be
> smart
> enough to follow the redirect to return the actual file contents. How can
> I
> get at the redirected filename?
>
> The problem is the file contains html and relative references in href's
> buried in the html are relative to the redirected location and not my
> original location, and I would like to subsequently open some of those
> files
> (like a crawler does).

http://php.net/curl
will give you the control to follow or not follow re-directs, as well as
access to all the headers that are coming in to figure out what's going
on.

If it's an IIS/ASP site, count on three or four re-directs for no apparent
reason, other than to waste resources and sell more hardware/software. :-p

--
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

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