Zend - The PHP Company




HTML

Add Code


A automatic reload of a page n times only  

Type: application
Added by: damtam
Entered: 08/12/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 9776
This Script will make an automatic reload of the current page, but only for a limited number of time (useful to update content without wasting ressources)


<!-- put this code just before </head>  -->

<?php 
$interval
=4//duration between successive downloads (seconds)
$maxdownload=4//maximum number of successive downloads

if(strlen($nbrereload) < $maxdownload ){ 
    
?><META HTTP-EQUIV="REFRESH" CONTENT="<?php echo $interval?> ; URL=http://<?php
    
echo $REMOTE_ADDR.$PHP_SELF
    if(
$QUERY_STRING==""){
        
$myquery="?nbrereload=i";
    }else{
    
$myquery="?".str_replace("nbrereload=i","nbrereload=ii",$QUERY_STRING);
    };
    echo 
$myquery;
 
?>" ><?php }; ?>


Usage Example


See the example


Rate This Script





Search



This Category All Categories