this scipt is much easier and simple, just save it as randomscript.php or whatever you want, change the paths to your images and upload the script to your website, then in your welcome template put this include function
{php}
include("http://www.yourwebsite.com/path/to/randomscript.php");
{/php}
and change the paths to where you uploaded the file, let me know if it works, this is a great script and you can change the paths to an html file or another website, whatever you want really
Quote:
<?php
srand((double)microtime()*1000000);
$randomtopic = rand(0,11);
if ($randomtopic == "0") {
header('Location: http://www.yourwebsite.com/path/to/image01.jpg');
} else if ($randomtopic == "1") {
header('Location: http://www.yourwebsite.com/path/to/image02.jpg');
} else if ($randomtopic == "2") {
header('Location: http://www.yourwebsite.com/path/to/image03.jpg');
} else if ($randomtopic == "3") {
header('Location: http://www.yourwebsite.com/path/to/image04.jpg');
} else if ($randomtopic == "4") {
header('Location: http://www.yourwebsite.com/path/to/image05.jpg');
} else if ($randomtopic == "5") {
header('Location: http://www.yourwebsite.com/path/to/image06.jpg');
} else if ($randomtopic == "6") {
header('Location: http://www.yourwebsite.com/path/to/image07.jpg');
} else if ($randomtopic == "7") {
header('Location: http://www.yourwebsite.com/path/to/image08.jpg');
} else if ($randomtopic == "8") {
header('Location: http://www.yourwebsite.com/path/to/image09.jpg');
} else if ($randomtopic == "9") {
header('Location: http://www.yourwebsite.com/path/to/image10.jpg');
} else if ($randomtopic == "10") {
header('Location: http://www.yourwebsite.com/path/to/image11.jpg');
} else if ($randomtopic == "11") {
header('Location: http://www.yourwebsite.com/path/to/image12.jpg');
} else {
echo ( "ERROR: There was a problem running the script. ");
}
?>
|
just PM if you want to see this script in action