|
Random Image (requirements: PHP 4 or greater)
This short PHP script will display a random image on a page using an
<img> link. It calls a random image from a directory you
specify in the script. Valid image file types are gif, jpg, and png.
Follow the instructions below to install it:
- Copy the code to the right (click on Copy the Code).
- Create a new file and paste the code. Save it as random.php
or similar.
- Put the script in the same folder as the images you want to
randomly display. The images should all be the same
dimensions, otherwise stretching will occur.
- Link to the file as you would any image:
<img src="http://your-domain.com/random_images/random.php"
border="0">
and/or
[img]http://your-domain.com/random_images/random.php[/img]
|
|