Image rotation from a folder in different domain

Associate
Joined
19 Jul 2006
Posts
1,847
Right I kind of understand how rotation scripts work.
Code:
<?php

// random number 1 - 100 
$result_random=rand(1, 100);

// if result less than or equal 70, display ad 1 (70%)
if($result_random<=70){
echo "Display ad1";
}

// if result less than or equal 90, display ad 2 (20%)
elseif($result_random<=90){
echo "Display ad2";
}

// if result less than or equal 100, display ad 3 (10%)
elseif($result_random<=100){
echo "Display ad3";
}

?>

However what im after it to be able to put some code into a website that pics a random image from a folder on another domain.
I want to be able to add images to this folder afterwards which will then be included in the webpage. BUT without me having to alter any code in the webpage.

What should i be looking up


Edit: is it also posible to make the image a link. But again the links will be to different places depending on the image
 
Last edited:
Would it be doable by creating a php script that linked to a database work where each record has a referene to image location and a link location

eg
PHP:
Connect to database

Get number of rows. 

Us number of rows to get a random number then return that date.

Then use that data to populate the box
 
Back
Top Bottom