frame auto refresh

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
me666
Forum Commoner
Posts: 87
Joined: Wed Oct 08, 2008 5:04 pm

frame auto refresh

Post 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?
me666
Forum Commoner
Posts: 87
Joined: Wed Oct 08, 2008 5:04 pm

Re: frame auto refresh

Post 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>
User avatar
Weasel5-12
Forum Commoner
Posts: 37
Joined: Tue Sep 16, 2008 6:58 am

Re: frame auto refresh

Post 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();
?>
 
me666
Forum Commoner
Posts: 87
Joined: Wed Oct 08, 2008 5:04 pm

Re: frame auto refresh

Post by me666 »

Thank you for that.....
does the job gr8
me666
Forum Commoner
Posts: 87
Joined: Wed Oct 08, 2008 5:04 pm

Re: frame auto refresh

Post 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?
Post Reply