Automatic page redirection

0

I have 3 panels, example:

panel1.php

panel2.php

panel3.php

They will be displaying on a monitor, which would like:

Let one be opened on the screen, and every 10 seconds the browser automatically switches to the other.

How could you do this?

    
asked by anonymous 02.06.2016 / 17:10

2 answers

2

You can do this with HTML meta tags, insert them in <head> :

With time interval of 10 secs in each, in your case:

From panel1.php to panel2.php, insert the following meta tag in panel1.php:

<meta http-equiv="refresh" content="10;URL=painel2.php">

From panel2.php to panel3.php, enter the following meta tag in panel2.php:

<meta http-equiv="refresh" content="10;URL=painel3.php">

From panel3.php back to panel1.php, insert the following meta tag in panel3.php:

<meta http-equiv="refresh" content="10;URL=painel1.php">

This will be looping

    
02.06.2016 / 17:28
1

Since it will be exposed, better to use a Javascript to put a transition effect, redirect are not aesthetically legal.

HTML

<div class="wrap"></div>        

CSS

* {padding:0;margin:0;}
.wrap {width:100%;height:100%;display:none;}

JS

$(document).ready(function(){ 

    //As páginas a serem carregadas devem estar na mesma pasta da sua aplicação
    url1 = 'money.php';
    url2 = "moneyMoney.php";
    url3 = "moneyMoneyMoney.php";
    atual = 2;

    $('.wrap').fadeIn(2000).load(url1);
    setInterval(trocar,15000);    

    function trocar(){
        $('.wrap').fadeOut(2000,function(){ 
            switch(atual){
                 case 1: 
                     $('.wrap').load(url1);
                     atual++; 
                 break;
                 case 2:
                     $('.wrap').load(url2);
                     atual++; 
                 break;
                 case 3: 
                     $('.wrap').load(url3);
                     atual = 1; 
                 break;
            }
            $('.wrap').fadeIn(2000); 
        });   
    }

});
    
02.06.2016 / 18:17