|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Double refresh
I have a PHP page that has JavaScript code that makes the page auto-refresh every 4 minutes.
Inside that page I have an include that points to anoter file. I want for that page to auto-refresh every 10 seconds. In other words, the main page refreshes every 4 minutes. And the page inside it refreshes every 10 seconds. Not sure if I explained it right. Here is sample code. Main Page: php: -------------------------------------------------------------------------------- <?php include('refresh.php') ?> <table> <tr> <td> <?php include('fisn_whole.php') ?> </td> </tr> <tr> <td> <?php include('fisn_snip.php') ?> </td> </tr> </table> -------------------------------------------------------------------------------- Now the explanation from top to bottom: 'refresh.php' Contains JavaScript that refreshes the page eveyr 4 minutes. 'fisn_whole.php' This page loads a table from a text file that gets dumped to our server by one of our machines. 'fisn_snip.php' This page reads another text file that gets dumpled to our server by one of our machines. This text file only gets created when there is an error. When the page is loaded, if there is an error, an alert appears. So, the idea is for fisn_snip.php to auto-refresh every 10 seconds. And this refresh to be independent from the auo-refresh every 4 minutes that the main page has. Hopefully this makes sense. Just in case, here is my refresh code: php: -------------------------------------------------------------------------------- <script> <!-- // Enter Refresh Time in "minutes:seconds" // Minutes should range from 0 to inifinity. // Seconds should range from 0 to 59. var limit="4:00" if (document.images){ var parselimit=limit.split(":") parselimit=parselimit[0]*60+parselimit[1]*1 } function beginrefresh(){ if (!document.images) return if (parselimit==1) window.location.reload() else{ parselimit-=1 curmin=Math.floor(parselimit/60) cursec=parselimit%60 if (curmin!=0) curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!" else curtime=cursec+" seconds left until page refresh!" window.status=curtime setTimeout("beginrefresh()",1000) } } window.onload=beginrefresh //--> </script> ?> -------------------------------------------------------------------------------- |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Double refresh |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|