This PHP script is self explanatory, including comments, recommendations and instructions. It displays a random image from a directory, always within a max width and/or length and maintaining its original ratio between width and length and calculated before displaying it. It includes comments to make it easier to understand and implement, no php knowledge is needed. It has only 3 variables: $path = name of the directory where to put the images to display (in the example: 'aa_Images/') // Indicate meximum height of the image to display $max_height = max expected height (in the example: 125) $max_width = max expected width (in the example: 200) Please have in mind that filenames should not contain blank spaces! eventhough it may work in some cases. Please also have in mind that the original images are not changed in any way, they are just displayed in a different size so take care with their size when putting them in the directory where to pick them from as, if really large, they may penalize your page with a long time to download it. I am using it to display random images to give my visitors the sensation that the page has changed. You can also use it to display funny images which would give your visitor an incentive to visit your page to see what's new without any action from your side to do any change. Hope you find it useful as I did and please don't forget to post your comments and small utilities and developments as they can be useful to others. Internet is developed based on the sharing principle. You can see it working at: Here we left 5 images of different sizes to see the functionality. You can contact me at Good luck! Fred www.learngolfvideos Twitter: @LearnGolfVideos Facebook: fred.learngolfvideos or Learn-Golf-Videos/432483040122943