colombian Posted April 30, 2008 Share Posted April 30, 2008 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. Link to comment https://forums.phpfreaks.com/topic/103630-is-url-responding-function-check-to-see-if-url-is-responding/ Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Use the PEAR Net::Ping function to check if the site is up. (The package is Net and the function is Ping, obviously) Link to comment https://forums.phpfreaks.com/topic/103630-is-url-responding-function-check-to-see-if-url-is-responding/#findComment-530672 Share on other sites More sharing options...
colombian Posted April 30, 2008 Author Share Posted April 30, 2008 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? Link to comment https://forums.phpfreaks.com/topic/103630-is-url-responding-function-check-to-see-if-url-is-responding/#findComment-530692 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.