On Mon, 6 May 2002, Luc Saint-Elie wrote:
> I use a class to parse a RSS feed, my problem is that when the distant
> site is down my own site is stuck (because my class waits for an answer
> that doesn't come..) The logical answer is to use a fsockopen before to
> control the connection. Reading the doc I see : int fsockopen ( string
> hostname, int port [, int errno [, string errstr [, float timeout]]])
> 
> fsockopen allows to control if the hostname is up and running
> 
> My problem is that hostname returns the home page that is in HTML, the page 
> that I want is a php page.
> 
> HTML page are not often down (only when all the server is down) php pages 
> are often down (because mySQL problem or PHP problems)
> 
> So I'd like to be able to control if a specific url is OK and not only the 
> hostname.
> 
> How can I do that ?

Does the class already use fsockopen() to make the connection? If not, 
then throwing in a call to that function won't do anything. It's a 
fundamentally different way of having PHP get the data, and the class 
would have to be rewritte.

I'm also not clear on what you're really asking. You want to set a timeout 
but you only want it to apply to pages that you are guessing were 
generated by PHP, because you don't think that pages you guess are static 
will need it? Why would it hurt to use the timeout there too?

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to