speaker219 Posted July 20, 2007 Share Posted July 20, 2007 How would i make a script that would get all of the pictures in a folder, and display one, but include a "Next Picture >>" and "Previous Picture <<" link. so when you first open the script you get 1 picture, and a link to go to the next/previous one. i wrote a script that gets all of the images in a folder and displays them, but i don't want it to show all of them at once. <?php $ignore = array('.','..','index.php'); $handle = opendir('.'); while ($file = readdir($handle)) { if (!in_array($file, $ignore)) { echo '<img src="'.$file.'"><br><hr>'; } } closedir($handle); ?> Any help would be appreciated Link to comment https://forums.phpfreaks.com/topic/60914-picture-gallery-script-help/ Share on other sites More sharing options...
speaker219 Posted July 20, 2007 Author Share Posted July 20, 2007 Also, i know there are other premade scripts out there, but i would like to make my own that is nice and simple Link to comment https://forums.phpfreaks.com/topic/60914-picture-gallery-script-help/#findComment-303123 Share on other sites More sharing options...
speaker219 Posted July 20, 2007 Author Share Posted July 20, 2007 Bump Link to comment https://forums.phpfreaks.com/topic/60914-picture-gallery-script-help/#findComment-303422 Share on other sites More sharing options...
jorgep Posted July 20, 2007 Share Posted July 20, 2007 Are you still wating for this script? I can give you a hand, let me know Link to comment https://forums.phpfreaks.com/topic/60914-picture-gallery-script-help/#findComment-303704 Share on other sites More sharing options...
speaker219 Posted July 21, 2007 Author Share Posted July 21, 2007 Yup, i'm still waiting. Link to comment https://forums.phpfreaks.com/topic/60914-picture-gallery-script-help/#findComment-303819 Share on other sites More sharing options...
speaker219 Posted July 21, 2007 Author Share Posted July 21, 2007 Bump Link to comment https://forums.phpfreaks.com/topic/60914-picture-gallery-script-help/#findComment-304289 Share on other sites More sharing options...
marcus Posted July 21, 2007 Share Posted July 21, 2007 $path = "/home/path/to/your/folder"; $handle = @opendir($path) or die("Unable to open $path"); echo "<table border=0 cellspacing=3 cellpadding=3>\n"; $x=1; echo "<tr>\n"; while($file = readdir($handle)){ echo "<td><img src=\"$file\"></td>\n"; if($x == 5){ echo "</tr><tr>\n"; $x=0; } $x++; } echo "</tr>\n"; echo "</table>\n"; closedir($handle); Link to comment https://forums.phpfreaks.com/topic/60914-picture-gallery-script-help/#findComment-304292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.