Jump to content

Recommended Posts

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>";

 

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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.