Hi, Does anyone know of a simply slide show script that just have the image and then a previous and next button. Also it needs to run from a folder that i specify. I have looked everywhere but i cannot find one that will just work from a folder the i specify. Cheers, Adam
<?php $my_folder = "my_images"; $files = array(); if ($handle = opendir($my_folder)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") array_push($files,$file); } closedir($handle); } if ( isset($_GET['id']) ) $id = $_GET['id']; else $id = 0; ?> <img src="<?=$my_folder."/".$files[$id];?>" alt="" /><br /> <?php if ($id > 0) echo "<p style=\"width:200px; float:left;\"><a href=\"".$_SERVER['PHP_SELF']."?id=".($id-1)."\">Previous</a></p>"; else echo "<p style=\"width:200px; float:left;\">Previous</p>"; if ($id <= count($files) - 2) echo "<p style=\"float:left;\"><a href=\"".$_SERVER['PHP_SELF']."?id=".($id+1)."\">Next</a></p>"; else echo "<p style=\"float:left;\">Next</p>"; ?> PHP:
you're welcome. need anything else let me know. was feeling generous. not the best looking, but i just slapped it together for you.