0

How can I, on every 10 seconds include different html page which is placed in my root folder? I need to change home page on 10 sec and I must use php code without using .htaccsess file. Please someone help

I tried this

<?php
    $redirectionTime = 5;
    $newPageUrl = "vrnjacka_banja2.php";
    header( "Refresh: $redirectionTime; url=$newPageUrl" );
?>
BWA
  • 5,672
  • 7
  • 34
  • 45
s. d
  • 1
  • 1
  • but i must use another way that not use .htaccsses file – s. d Feb 13 '16 at 19:21
  • you need to fetch all file names for your alternative home pages, and then loop and save id to a cookie. However, when you redirect the user to another page, you must run it again. – peixotorms Feb 13 '16 at 19:25
  • Possible duplicate of [Page redirect after certain time PHP](http://stackoverflow.com/questions/6119451/page-redirect-after-certain-time-php) – manniL Feb 13 '16 at 19:25
  • You can use cron job - http://stackoverflow.com/questions/18737407/how-to-create-cron-job-using-php – Sohel Ahmed Mesaniya Feb 13 '16 at 19:27
  • Redirect every 10 sec isn't really user friendly. Why don't you use some client side feature for changing your page instead ? – TGrif Feb 13 '16 at 20:56
  • This code at the top work fine if i put in every page and redirect in circle. But problem is that every other page is html page not php. – s. d Feb 13 '16 at 23:38
  • is there any function which i can use to change pages after some time like slider?? – s. d Feb 13 '16 at 23:39
  • so i need to create one index.php file and inside create something like playlist of 20 pages.html and let to change them on time interval??? – s. d Feb 14 '16 at 09:47

0 Answers0