Home Forum
2026-07-14
Benvenuto, Ospite
Nome Utente Password: Ricordami

Redirect to list of URLs
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: Redirect to list of URLs

Redirect to list of URLs 13 Anni, 3 Mesi fa #3554

  • nforse
  • Offline
  • Fresh Boarder
  • Messaggi: 1
Hi I looked through the forum and help files and couldn't find anything specific to my question.

Is it possible with MACROS to redirect to a specific list of URLs? Sometimes 1 or 3 or 4 different URLs.
Currently I'm redirecting to a PHP file that decides which URL to randomly show.

I'm hoping there is someway of doing this directly in ReDJ?

Any help is much appreciated.

Here's the PHP file I'm using

<?php

$link[1] = "www.URL1.com";

$link[2] = "www.URL2.com";

$link[3] = "www.URL3.com";

if(!isset($HTTP_cookie_VARS['link'])){ $n=count($link);

$rand=rand(1,$n); setcookie("link",$rand,time()+1500);

header('location:'.$link[$rand]); }else{ $go=$link[$_COOKIE['link']]; header('location:'.$go); }

?>
L'Argomento è stato bloccato.

Re: Redirect to list of URLs 13 Anni, 3 Mesi fa #3555

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi,
it is not possible with macros, but should be easy to add a new macro that chooses a random placeholder. Something like:

$link1=http://www.url1.com
$link2=http://www.url2.com
$link3=http://www.url3.com
$link={random}${link1},${link2},${link3}{/random}


The only "issue" here is you have a full random behaviour, no cookie storage at all.

Kind regards,
Luigi
Ultima modifica: 13 Anni, 3 Mesi fa Da admin.
L'Argomento è stato bloccato.
  • Pagina:
  • 1
Moderatori: admin
Tempo generazione pagina: 0.20 secondi