GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Random Redirect Javascript (https://gfy.com/showthread.php?t=405296)

mkx 12-19-2004 04:16 PM

Random Redirect Javascript
 
Is there a Javascript or PHP script out there that will automatically redirect a page to a random url? :helpme

European Lee 12-19-2004 04:20 PM

Use this..

PHP Code:

<?php 
$fileName 
"ads.txt"
mt_srand( (double) microtime() * 1000000 ); 
$a file($fileName); 
$randNum mt_rand0sizeof($a)-); 
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 :thumbsup

Regards,

Lee

mkx 12-19-2004 04:38 PM

Thank you to European Lee & Intrigue for your help :thumbsup


All times are GMT -7. The time now is 11:19 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123