everisk Posted October 18, 2007 Share Posted October 18, 2007 Hi, I have a code where I need to use an IFRAME to load something from external page then display that the process has succeeded, then a message shows that user can close the browser. Now I'm using sleep() to delay the page (and hope that the IFRAME will finish loading within that time). But I dont think this is working as different people have different connection speed. Below is the short version of my code. Many thanks in advance! echo "<div align=center><iframe src='http://xxx.com' frameborder=\"0\" width=\"1\" height=\"1\"></iframe></div>"; echo "<div align=center><iframe src='http://www.xxx.com' frameborder=\"0\" width=\"1\" height=\"1\"></iframe></div>"; sleep(10); echo "<div align=\"center\">Success!</div>"; Quote Link to comment https://forums.phpfreaks.com/topic/73825-wait-until-iframe-finish-loading-then-resume-code/ Share on other sites More sharing options...
0x00 Posted October 18, 2007 Share Posted October 18, 2007 Do you realise how php works? When php echo's or print's, it put's this on the file stream that is being returned to the client browser, therefore the iframe statement won't be executed untill it is client side... You could use php to read the file and dump it to the client inline, or maybe use some form of javascript on the clientside... Quote Link to comment https://forums.phpfreaks.com/topic/73825-wait-until-iframe-finish-loading-then-resume-code/#findComment-372464 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.