Jump to content

"Is URL responding" function? (check to see if URL is responding...)


colombian

Recommended Posts

This should be easy, but I cannot figure out how to phrase to question properly to get an answer in Google.

 

My page calls an iframe (I would rather it not, but got no choice). Sometimes, the iframe is VERY VERY slow, other times unavailable. I want to display an error/sorry message if the iframe is unavailable, or display the actual iframe if all is fine.

 

How would I go about that?

 

in psudo-code:

 

$url = "this-never-changes.iframe";

// INSERT special-php-function-to-check-url

if (URL available) {

// iframe code all over here

}

else {

echo "Sorry this section is temporarily unavailable";

}

 

Any help would be appreciated - thank you.

 

 

 

I don't really want 1400+ lines of code plus additional packages for this functionality though.

 

My checks through ping functions has lead me to the following error in PHP:

----

Warning: fsockopen() [function.fsockopen]: unable to connect to https://REMOVED.security (Unable to find the socket transport "https" - did you forget to enable it when you configured PHP?) in SERVER_PATH/iframe-test.php on line 51

---

 

I don't have control of the PHP server - is that  a clear indication I won't be able to use the fsockopen function?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.