Page 1 of 1
frame auto refresh
Posted: Sat Nov 08, 2008 12:59 pm
by me666
I have a page that displays 2 frames, works great and does what i want, BUT, 1 of the frames read data from a mysql table and needs to be updated regularly. I put the normal meta refresh string inside the file that holds the data for that frame, but once u load the page all works fine and refreshes fine, BUT when you navigate away from the page it still keeps refreshing the page holding the data for the frame. It dosen't display the page, but you can see it loading in the status bar. With this always reloading it isusing up my bandwith. I though maybe you could use a script to reload the frame from the parent file, maybe this will stop it reloading when you leave the page. This is the parent file:
Code: Select all
<html>
<title>My Page</title>
<frameset rows="80%,*">
<frame src="frame1.php" name="1">
<frame src="frame2.php" name="2">
</frameset>
</html>
Any ideas?
Re: frame auto refresh
Posted: Sun Nov 09, 2008 4:10 pm
by me666
AH HA, sorted it... I went looking on the net and found a java script refresh code, so i tried that. It works so that will do for me. I now use the following java script instead of the meta tag:
Code: Select all
<script type="text/javascript">
setTimeout("location.replace('target.html')",5000);
</script>
Re: frame auto refresh
Posted: Thu Nov 13, 2008 11:12 am
by Weasel5-12
i've found a much easier method for your problem
simple php code..
Code: Select all
<?php
function refresh(){
// "content='3;" where 3 is time in seconds.
echo "<meta http-equiv='refresh' content='3; url=http://yoursite.com'>";
echo "Please wait while you are re-directed";
}
.....
.....
// calls function
refresh();
?>
Re: frame auto refresh
Posted: Sat Nov 15, 2008 12:29 pm
by me666
Thank you for that.....
does the job gr8
Re: frame auto refresh
Posted: Sat Nov 15, 2008 12:42 pm
by me666
ok another problem, similar to the last 1, i have started converting my website into frames. I have 3 frames on each page, 1 for the menu, 1 for the login script, and 1for the page content. When i login in 1 of the frames i want it to refresh the whole page, all 3 frames,but as it is now it only refreshes the frame holding the login script. Any ideas please?