FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » fopen with URL *never* fails
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: fopen with URL *never* fails [message #172618 is a reply to message #172558] Tue, 22 February 2011 09:09 Go to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 2/21/2011 9:38 PM, acoleman616 wrote:
> On Feb 21, 2:36 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 2/21/2011 2:33 PM, acoleman616 wrote:
>>
>>> Hi all,
>>
>>> I'm at a loss. I'm calling fopen(), passing it absolute URLs, and
>>> when the URLs are from one, and only one, of my public domains, no
>>> matter what URL I pass, it *always* executes successfully. So even if
>>> I pass it a URL of a file that I *know* doesn't exist, fopen() still
>>> executes and does *not* return false, as it should.
>>
>>> Any ideas?
>>
>>> Thanks in advance for any help.
>>
>> Check what is returned - it's probably a "Page Not Found" page, so the
>> fopen() completed.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> Ah, didn't think of that. Is there any way to detect if a 404 is
> returned from the original URL passed to it?

Hi,

Have a look at: get_headers($url)
http://nl3.php.net/manual/en/function.get-headers.php

Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: about memory usage with application written with php and mysql
Next Topic: Customisable Printing by PHP from Flash
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 00:53:21 GMT 2024

Total time taken to generate the page: 0.04108 seconds