Home  >  Q&A  >  body text

Change page refresh timer

I have a specific requirement that my page refreshes after 2 seconds. I have used this code to achieve this functionality -

<?php
    $page = $_SERVER['PHP_SELF'];
    $sec = "2";
?>
<html>
    <head>
        <meta http-equiv="refresh" content="<?php echo $sec?>;URL='<?php echo $page?>'">
    </head>
</html>

Now I need a button that can change the refresh time from 2 seconds to 10 seconds to achieve different functions.

If anyone could suggest how I should achieve this, that would be of great help. Thanks

P粉354948724P粉354948724259 days ago385

reply all(1)I'll reply

  • P粉578680675

    P粉5786806752024-02-27 09:32:14

    Add button with js code: In HTML

    Add tag ID in metadata

    Add js script to the page

    renew: Result page:

    
    
        
            
        
        
        
            
        
    

    reply
    0
  • Cancelreply