php tutorials / random imageThis script will make a different image appear every time a page is reloaded.** Make a php file called "randomimage.php" the code
<?phpheader("Content-Type: image/gif"); $sigs = array(); $sigs[] = "imagename1.gif"; $sigs[] = "imagename2.gif"; $sigs[] = "imagename3.gif"; mt_srand((double)microtime()*1000000); $sig = $sigs[mt_rand(0, count($sigs)-1)]; readfile($sig); ?> ** Place the following code on your page where you want the random image to display: the code
<?php include("randomimage.php"); ?> |
|
|