Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display nextpage automatically in certain time (10 sec) in php?

Tags:

php

I have numbers of pages with data . I want to show that next page of current page automatically in 10 sec and now i have 2 link for next and back. But i want to show it automatically. If the page count comes to last page then it will show the first page.

for ($counterstart=$startcounter ;
    $counterstart<=count($device)-1;$counterstart++){
    $entry = $device[$counterstart] ;     
    echo "page";    
}

if ($startcounter ==$result ){
    echo " Back ";
}else{
   echo "Next";
}           
like image 973
TOM Avatar asked Sep 26 '22 02:09

TOM


2 Answers

You can do via <meta> http-equiv Attribute as below augment content with time and next page URL

<head>
    <meta http-equiv="refresh" content="10;http://www.metatags.info/meta_http_equiv">
</head>

Reference - http://www.metatags.info/meta_http_equiv

JSFifddle

like image 146
Ramratan Gupta Avatar answered Nov 01 '22 10:11

Ramratan Gupta


You can't do this on the server side*. Use JavaScript: timeouts and Ajax in the Webpage to pull new content.

Searching for these Keywords will take you to a tons of examples and tutorials each.

(*) or at least it is very complicated

like image 26
CoderPi Avatar answered Nov 01 '22 10:11

CoderPi