Random Image Scripts
Everyone likes to have random images in their forum signatures and such but not everyone knows how to code a script to achieve this. This page will have links to well-coded random image scripts in a variety of languages.
A large majority of random image scripts available are poorly coded and do not take into account cachability and such. An example script in PHP may find the image filename and then use
fpassthru() which will make the result uncachable, wasting bandwidth every time the script is called.
PHP
randomimg.php by R1CH, public domain.
Tested on PHP 4.x and 5.x. To use this, you will require a PHP enabled web host. Drop the script as randomimage.php into some directory, then make a directory called 'images' and drop your image files into it. Then link your randomimage.php as if it were an image, for example on a web forum, you may use vB code such as
[img]http://shsc.info/files/randomimg.php[/img].
This article is ©2008 by the respective authors. Reproduction is prohibited without express permission from all contributors.