Random Redirect Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkx
    Confirmed User
    • Nov 2003
    • 4001

    #1

    Random Redirect Javascript

    Is there a Javascript or PHP script out there that will automatically redirect a page to a random url?
  • European Lee
    Confirmed User
    • Dec 2002
    • 7133

    #2
    Use this..

    PHP Code:
    <?php 
    $fileName = "ads.txt"; 
    mt_srand( (double) microtime() * 1000000 ); 
    $a = file($fileName); 
    $randNum = mt_rand( 0, sizeof($a)-1 ); 
    header( "Location: ". $a[$randNum] ); 
    ?>
    Also create a .txt file with one url on each line and upload it to the location defined in $fileName = "ads.txt";

    Then rename the .php file to something like index.php and upload to your server

    Regards,

    Lee
    YOUR TRAFFIC IS SAFE WITH US - CONDOM CASH
    PUTTING THE GAY ADULT INDUSTRY ON YOUR PC!!
    AFFORDABLE 2257 COMPLIANT GAY + BI CONTENT

    Comment

    • mkx
      Confirmed User
      • Nov 2003
      • 4001

      #3
      Thank you to European Lee & Intrigue for your help

      Comment

      Working...