Help with random picture generator

Discussion in 'HTML & Website Design' started by BEEJAY, Oct 1, 2009.

  1. #1
    If you go to the website www.boneyourmother.com [NSFW] you'll see that the front page just generates a new picture, every time you hit refresh, from a list of pictures in a folder located at www.boneyourmother.com/random

    The only problem is if you right click on the front-page picture and go to properties, you get the php file, (http://www.boneyourmother.com/rotate.php) for an address, instead of the picture's actual URL.

    I would like people to be able to easily link the pictures they find to their friends. If it would show the link properly in properties or even if it just printed the correct url below the image every time it was refreshed, that would be great.

    Can anyone help me out? I can provide you with the php code if thats of any help. Thanks.
     
    BEEJAY, Oct 1, 2009 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    This can be done easily with PHP. Just have PHP scan the directory, and pull a random file name from the list of images. Then, output your image as any other image, <img src="url_here" alt="img desc"/> and so on, they can link to it just like any other image, and its random on every page load.

    If you need help with the php code to pull a random file, let me know, also, please read my signature. Enjoy!
     
    crath, Oct 3, 2009 IP