Forum Moderators: coopster

Message Too Old, No Replies

iframe or Include.which is best?

         

vphoner

12:36 am on Jun 22, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



I am showing external code on a site (through a link). I was using iframes, but when I had some PHP code called in the iframe (a new mod), it slowed down a lot. Then I tried "include" in PHP for the external code and it went much faster.

Now it seems like my decision at this point was to use the include statement for this code, but one day the server of the external code went down, and my page did not load at all, just a blank screen. What this means is if you use the "include" statement and the page you reference is not available, that your whole page will not load
even if the include is down the page a ways.

Is there a way around this problem? I want the page to load "without" the included code if it is not available (or too slow) or show alternate code, but do not want the page not to load like it did that day.

Is there a way to test the included file (whether it is available or not loading too slow)?

jatar_k

1:25 am on Jun 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could try using an fopen on the file before you include it, if that doesn't work then skip it

though not all servers can do an fopen on urls