سؤال

Is there any way of refreshing an iframe every time the src file changes? I am thinking about something like this:

while(1){
   $f1=readfile('file');
   sleep(0.2);
   $f2=readfile('file');
   if ($f1!=$f2){
       //(Reload iframe)
   }
}
هل كانت مفيدة؟

المحلول

Actually i have an idea. You can use the sleep command to refresh an iframe if you put it inside an actual html frame on the website. So, the frame that contains the iframe reloads, leaving the rest of the page the same. This may work for you?

نصائح أخرى

no, this is not possible in php. What you can do is do polling and ask the server after every x seconds if there is any change in the file contents.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top