Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 28th, 2005, 12:36 AM
jweizenblut jweizenblut is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Miami, Fl. US
Posts: 522 jweizenblut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 29 sec
Reputation Power: 2
Send a message via AIM to jweizenblut Send a message via Yahoo to jweizenblut
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>
?>

--------------------------------------------------------------------------------

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Double refresh


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT