Random Image Tutorial

fusionballa

New Member
Messages
34
Reaction score
0
Points
0
This tutorial will teach you how to rotate images. Good for affilate rotations =)


Code:
   First of all create a file called something like randomimg.php.

  Also make sure all the images you are using are in the same directory as randomimg.php.

  Then copy and paste the code into your file.


                          <?php
        header("Content-Type: image/gif");
        $sigs = array();
        $sigs[] = "imagename1.gif";
        $sigs[] = "imagename2.gif";
        $sigs[] = "imagename3.gif"; 

        mt_srand((double)microtime()*1000000);
        $sig = $sigs[mt_rand(0, count($sigs)-1)];

        readfile($sig);
        ?>                      

  Now add this code to the page you want the images to show up on, make sure it's    extension is .php also.

  <?php include("randomimage.php"); ?>
 

r0gUe

New Member
Messages
84
Reaction score
0
Points
0
thanks i was wondering what the code was cuz i need it for my links ;)
 

Articz

New Member
Messages
864
Reaction score
0
Points
0
nice tut there but is there a way of making the images links to those site or have i just not read the code :)
 

limelight

New Member
Messages
798
Reaction score
0
Points
0
Isn't there a completely shorter and easier code. Or did I just make it up in my head.
 

Conor

New Member
Messages
3,570
Reaction score
0
Points
0
Just a cool thing you can use for forums relating to this:

1. Make a plain HTML page with the random image code on it.

2. Point out that page for your avatar (or the image on the page).

3. EVery time the page refreshes/reloads, your avatar will be different :eek:riginal:
 
Top