PHP image slideshow - auto version - PHP5 */ // set the absolute path to the directory containing the images define('IMGDIR', 'C:\\wamp\\www\\upload\\wallpaper\\Dormitory\\'); // same but for www define('WEBIMGDIR', 'http://localhost/upload/wallpaper/Dormitory/'); // set session name for slideshow "cookie" define('SS_SESSNAME', 'slideshow_sess'); // global error variable $err = ''; // start img session session_name(SS_SESSNAME); session_start(); // init slideshow class $ss = new slideshow($err); if (($err = $ss->init()) != '') { header('HTTP/1.1 500 Internal Server Error'); echo $err; exit; } // get image files from directory $ss->get_images(); // set variables, done. list($curr, $caption, $first, $prev, $next, $last) = $ss->run(); /* slideshow class, can be used stand-alone */ class slideshow { private $files_arr = NULL; private $err = NULL;