redirect visitors to a specific link once every 24 hours

S_TiN_G

Registered Member
Joined
Jan 25, 2023
Messages
67
Reaction score
30
hi

I want to redirect visitors to a specific link once every 24 hours how?
 
On page load or on user interaction like click on button?
 
On page load or on user interaction like click on button?
I think sessions need to be logged into the database such that repeat sessions after 24 hours visits a link. Php would work fine.
 
I think sessions need to be logged into the database such that repeat sessions after 24 hours visits a link. Php would work fine.
There is no need for database. He can use device's local storage. On the other side we do not know what stack OP uses. For all we know he can use Go :D
 
hi

I want to redirect visitors to a specific link once every 24 hours how?
Please let us know following:
  1. What language is in use (js, php, python, etc.)
  2. How would you "manage" those external links? Do you have some backend or you plan to fix those URLs in some kind of array?
 
Here is some simple code. Also, to handle timestamps you should take care of sessions like store them on user device's local storage, etc.

PHP:
$url_list = [url_1, url_2, url_3, url_4, url_5];

$pick_one = array_rand($url_list);
$url_to_go = "Location: {$url_list[$pick_one]}"
header($url_to_go);
 
Set a cookie or use local storage on the users machine to get the 24 hour delay (at least).
 
Back
Top