Urgent fopen question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
When I use fopen on the URL:
fopen("http://home.pchome.com.tw/world/qoo4ko/110.jpg";, "r")
I would get the following error message:

-----------Error Message------------
Warning: fopen(): Circular redirect, aborting.
Warning: fopen(http://home.pchome.com.tw/world/qoo4ko/110.jpg): failed
to open stream: Permission denied

But when I use HTML (<img src="<?=$URL?>" alt="">), to display it, it
does display on the screen.

How come fopen cannot open certain URLs while <img> can display them.
Does anyone have any idea why this happens?

I'm try to use fopen to check if a link is broken.  If anyone has a
workaround solution, it would be great, too.

Thanks very much.

Re: Urgent fopen question


On 08/31/2004 06:57 AM, Ming wrote:
Quoted text here. Click to load it

This looks like the server is not accepting PHP user agent but it is
accepting certain browsers.

If that is the case, you need to spoof the request to look like other
browsers. In that case you may want to try this HTTP client class and
set the User-Agent: request header to Netscape or Internet Explorer user
agent id.



Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org /

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews /

Metastorage - Data object relational mapping layer generator

Re: Urgent fopen question

First of all, thanks for all the inputs.
However, I have tried them but still failed to come up with a correct way to do

If anyone has time to actually post a php code that works, it would be wonderful!


Site Timeline