jeudi 30 novembre 2023

Change URL every 10min based on redirect

I got 10 urls in a file.

I want to show each url for 10 minutes and when done start over again.

<?php

$version = "v1.01";

$linksfile = "urlrotator.txt";

$urls = file("$linksfile");
$url = rand(0, sizeof($urls) - 1);

$goto = "$urls[$url]";

header("Location: $goto");

This just rotate random.

Need to be based on time

The urlrotator.txt content look like following

nr1.html
nr2.html
nr3.html
nr4.html
nr5.html
nr6.html
nr7.html
nr8.html
nr9.html
nr10.html



Aucun commentaire:

Enregistrer un commentaire