[REQ] A Random-Link-From-List Redirect Script

OTrap

Elite Member
Joined
Jul 12, 2008
Messages
2,314
Reaction score
1,064
I'm assuming PHP (from talking with tacopocalypse) for this. All I need would be the ability to import a list (.txt) of links and generate a link that would redirect to any of the links in the list randomly.

Anything like this? Thanks and Rep for it.
 
I am new to the blackhat world so I don't know of a script... but a script like this would not be hard to make.
Please stay tuned for a basic script.
 
Last edited:
Here is a quick sample....

Code:
<?php
// load flat file into an array
$myfile = 'test.txt';
$lines = file($myfile);  
 
// randomly generate a number between 0 and the count of the last line in the array.
$line = rand(0, count($lines) - 1);
 
// server redirect to the randomize line of the file
header("Location: $lines[$line]");
?>

If you need any help with implementation just give me a PM.
 
Last edited:
I tend to use the array_rand() function to select a random array element.
Going off Inters code above:

Code:
<?php
// load flat file into an array
$myfile = 'test.txt';
$lines = file($myfile);  
 
// server redirect to the randomize line of the file
header("Location: " . array_rand($lines));
?>

Haven't tested it and also on my first coffee of the day, but should work ;)
 
I do need some help implementing this. Would anyone mind going into more detail? PM me your AIM, and I'll hit you up. If it works, shoot, I'll PayPal a couple bucks your way.
 
Nevermind. Got it.
 
Back
Top