View Single Post
Old 07-25-2008, 06:41 PM   #1 (permalink)
Patriotfan
The Wanderer
 
Join Date: Jul 2008
Location: USA
Posts: 7
Thanks: 3
Patriotfan is on a distinguished road
Default [Tutorial] Make a basic image/ad rotator

First, open up Notepad or any other text editor
Type in
Code:
<?php
$img = array();

echo $img[$count];
?>
Next is the fun part. Place the following code in between the above code
Code:
$img[] = '<img src=""  />';
$img[] = '<img src="" />';
$img[] = '<img src="" />';
You add the image links in the "" so a example would be <img src="http://image.com/image.png"
Now the final part of code. Put it after what you just did
Code:
$max = count($img) - 1;
$count = rand(0,$max);
So now the full code would be like this
Code:
<?php
$img = array();

$img[] = '<img src="" />';
$img[] = '<img src="" />';
$img[] = '<img src="" />';

$max = count($img) - 1;
$count = rand(0,$max);

echo $img[$count];
?>
Now Enjoy your image rotator
**Note**Save as .php

You can see a example one
Here
Patriotfan is offline  
Reply With Quote