Peng
Mwa: Just to say, I would only make the cookie last a week. There's no need for it to stay around that look, and it could bug some people...
Also, think you could make it also go to, say, .jpeg or .jpg or .gif files? I must admit not understanding the script fully (what do the colons do?), so I can't do it myself...
Or make it automatically figure out the number of images?
surprised
The cookie saves your place in the images. It means that you will allways see every image at least once. Therefore it lasts a long time.
razz
If you want to change it to another filetype, simply change .png to the filetipe. I'll adjust it to gif after this.
As for the number of images, that'd require 'file exists' testing stuff. And I can't be bothered to do that.
razz
It's rather easy to just adjust a number, seeing as all you need to do is count the number of images you have.
wink
To tell the truth, it's actually bigger than the large one I cut it down from. ^^;
(if the large one has the comments removed.)
<?PHP
$number_of_pictures = 9;
$number = (( isset( $_COOKIE['mwarotate'] ) )?$_COOKIE['mwarotate']:0;
$image = $number++;
$number = ($number == $number_of_pictures)?0:$number;
setcookie("mwarotate", $number, time()+60*60*24*365, "/")
header("location: ./".$image.".gif")
?>
There, that might be a tad easyer.
razz