Generates a random image from your list. Simply add more array values with your image url.
GD Functions must be enabled in the PHP setup.
Simply call the script as an image.Code:<?php
// Images array
$imgs = array();
// add $imgs[__current#__] = "__IMGAGE_URL__"; for more images
// image URLs must be relitive to the script
$imgs[0] = "sig_one.jpg";
$imgs[1] = "another_sig.jpg";
$imgs[3] = "new_sig.gif";
$imgs[4] = "yet_another_sig.png";
// choose a random image
$num = rand(0, sizeof($imgs) - 1);
// do a check
if(is_file($imgs[$num])){
// get type
if(strstr($imgs[$num], ".gif")){
*// display gif image
*header("Content-type: image/gif");
*$im = imagecreatefromgif($imgs[$num]);
*imagegif($im);
}elseif(strstr($imgs[$num], ".jpg") || strstr($imgs[$num], ".jpeg")){
*// display jpg/jpeg image
*header("Content-type: image/jpeg");
*$im = imagecreatefromjpeg($imgs[$num]);
*imagejpeg($im);
}elseif(strstr($imgs[$num], ".png")){
*//display png image
*header("Content-type: image/png");
*$im = imagecreatefrompng($imgs[$num]);
*imagepng($im);
}else{
*die("ERROR2!!!");
}
}else{
die("ERROR!!!");
}
?>
Example:
http://wade.realestateleavenworth.com/wadesig.php
Refresh it and it might change.
Note: Animated gifs lose there animation and it stays on the first frame.
Note2: IPB doesn't allow images with .php extentions so you can't you it for Invisionfree boards. Not sure about phpBB2 yet.