Pencarian

Minggu, 30 Juni 2024

PHP Redirect Random Link

 Random akses redirect ke 3 link target

<?php

// Daftar link tujuan

$linkTargets = array(

  "https://linktarget1.com",

  "https://linktarget2.com",

  "https://linktarget3.com"

);


// Mendapatkan nomor index secara acak dari array $linkTargets

$randomIndex = rand(0, count($linkTargets) - 1);


// Redirect ke link tujuan yang dipilih secara acak

header("Location: " . $linkTargets[$randomIndex]);

exit(); 

?>

© 2015 [BUG] GEDEBUG All Rights Reserved.