I'm looking at using random image rotation on one of my sites and have
found the following script very helpful:
http://www.alistapart.com/d/randomizer/rotate.txt
Everything works, but once you've randomly chosen the file on the
server wouldn't it be simpler/quicker to say ...
if ($img!=null) {
header("Location: ".$img."");
}
instead of ...
if ($img!=null) {
$ext = strrchr($img,'.');
if ($ext==".jpg") $ext = ".jpeg";
$contentType = 'Content-type: image/' . substr( $ext, 1,
(strlen($ext)) );
header ($contentType);
readfile($img);
}
I'm no expert, but this seems to work for me.
Please let me know if I've got this all wrong?
Thanks!
Jez