|
Post by Mike on Feb 6, 2005 21:43:38 GMT -5
<?php
$img_folder = 'http://www.bobbyhensley.com/images/banners'; $images = array('banner01.jpg', 'comingsoon01.jpg');
$num_images = count($images) - 1; $rand_num = rand(0, $num_images);
Header("Location: " . $img_folder . "/" . $images[$rand_num]);
?>
Now, you will first need a host that supports PHP, Ripway is one of them. Things we need to edit:
$img_folder = 'http://www.bobbyhensley.com/images/banners';
You will want to make a new folder in your host. Upload all the files into that folder. Then, copy the folder location inbetween the 'quotes'.
$images = array('banner01.jpg', 'comingsoon01.jpg');
This is just simply editting the file names into the 'quotes', seperated by a comma.
Now that you have the code editted, copy it into Notepad, and clickie "Save As". Save the file as "images.php". You need to make sure it saved as .php. Now all you have to do is upload that file to the host.
To display your images:
HTML:
<img src="http://yourhost.com/images.php" />
UBBC:
[img]http://www.yourhost.com/images.php[/img]
|
|