random imagescript

Discussion in 'General Discussion' started by striderkz, Jul 25, 2004.

  1. striderkz

    striderkz Member

    Posts:
    12
    Likes Received:
    0
    Joined:
    Jun 19, 2004
    Location:
    england
    hey
    how do u do tht random image thing in ure signature?
     
  2. flipske

    flipske Well-Known Member

    Posts:
    607
    Likes Received:
    0
    Joined:
    Jul 22, 2004
    Code:
    $images = Array(
                       Array("fname"=>"kait.png", "type"=>"png"),
                       Array("fname"=>"sig2.png", "type"=>"png"),
                       Array("fname"=>"idea12.png", "type"=>"png"),
                       Array("fname"=>"idea2.png", "type"=>"png"),
                       Array("fname"=>"barkait.jpg", "type"=>"jpg"),
                       Array("fname"=>"kait.jpg", "type"=>"jpg")
    
                    );
    
     $im = $images[rand(0, count($images)-1)];
    
     header ("Content-type: image/" . $im['type']);
    
     //output the bloody image directly
     $handle = fopen("./" . $im['fname'], "rb");
     $contents = fread($handle, filesize("./" . $im['fname']));
     fclose($handle);
     echo $contents;
     Die();
    ?>
    
     
  3. Gez

    Gez Well-Known Member

    Age:
    34
    Posts:
    1,696
    Likes Received:
    0
    Joined:
    Jul 20, 2004
    Location:
    Wales/UK
    you can't use php in sigs
     
  4. flipske

    flipske Well-Known Member

    Posts:
    607
    Likes Received:
    0
    Joined:
    Jul 22, 2004
    you can? put the code between [​IMG]
     
  5. Llamaman

    Llamaman Senior Member

    Posts:
    2,059
    Likes Received:
    0
    Joined:
    Apr 24, 2004
    Location:
    UK
    You can do it if .php is an acceptable extention for images in the forum you are visiting. Fortunatly i have enabled it here so you will be able to use random sig images :)
     
  6. Phoenixinferno

    Phoenixinferno Well-Known Member

    Posts:
    165
    Likes Received:
    0
    Joined:
    May 16, 2004
    :/ so in it where do you put the links??
     
  7. Dirty Socks

    Dirty Socks Well-Known Member

    Age:
    44
    Posts:
    509
    Likes Received:
    0
    Joined:
    May 22, 2004
    I used random image script for sigs. But I never used it here because I couldn't get it to work. Now it does. Hmmm odd.
     
  8. striderkz

    striderkz Member

    Posts:
    12
    Likes Received:
    0
    Joined:
    Jun 19, 2004
    Location:
    england
    ani one know the code?
     
  9. daprisoner

    daprisoner Well-Known Member

    Posts:
    1,148
    Likes Received:
    0
    Joined:
    Jun 6, 2004
    thats the code
     
  10. Dirty Socks

    Dirty Socks Well-Known Member

    Age:
    44
    Posts:
    509
    Likes Received:
    0
    Joined:
    May 22, 2004
    There is an easier script if you save your pics a gifs. You don't have to edit in all the picture names. You just put them all in the same folder thus never having to edit in the extention. The downside to having a generator is finding a free php host.
     
  11. Arez

    Arez Well-Known Member

    Posts:
    333
    Likes Received:
    0
    Joined:
    Jul 8, 2004
    1. Upload you sigs in a place that lets you have your own folder

    2. Get the Random sig .php script

    3. Upload it onto the folder

    4. Use the RANDOM.php in you brackets.

    Its what im doing now. Refresh and it should bring up a new one!
     
  12. daprisoner

    daprisoner Well-Known Member

    Posts:
    1,148
    Likes Received:
    0
    Joined:
    Jun 6, 2004
    ok, im lost, can someone tell me a place that i can have my own folder thingy, then Jeb, since u use it, can u tell us the easier script, and then can you tell me were do i put all that
     
  13. StinkyJoe

    StinkyJoe Well-Known Member

    Posts:
    59
    Likes Received:
    0
    Joined:
    May 31, 2004
    Location:
    Portugal
  14. RvN

    RvN Well-Known Member

    Age:
    34
    Posts:
    67
    Likes Received:
    0
    Joined:
    May 22, 2004
    Location:
    USA
  15. excel542

    excel542 Well-Known Member

    Posts:
    133
    Likes Received:
    0
    Joined:
    Jun 10, 2004
    Location:
    New Jersey
    Tahts cool and new info for me, didnt know you could use PHP in an image, well I dont know much about PHP anywayz so...
     

Share This Page