kate_rose Posted June 18, 2008 Share Posted June 18, 2008 I have an array with the names of the images I would like to display & I have a folder containing the images I would like to display. I just need the user to be able to see one image at a time and give them a forward & back button so they can scroll through them. I have written the forward & back php script to rotate through the array but I am now a bit stuck. I have looked at a bunch of tutorials but most are pretty complex. I just want to figure out how to pass the image name back to html & wait for a button click before sending the next one along. I know this is a NewB problem but thats because I am one. If someone could please point me toward a tutorial or example that would head me in the right direction I would greatly appreciate it. Kate Link to comment https://forums.phpfreaks.com/topic/110680-php-based-image-display-manual/ Share on other sites More sharing options...
stonelord Posted June 18, 2008 Share Posted June 18, 2008 Kate, I am also a NewB to programming. I have done more design work with flash and photoshop. Anyways, I found this site and downloaded a free really easy to use, and modify "Photo Gallery" written in php. It's really basic code and easy to adjust, but it helps you understand what it does and it may help you acomplish what you are looking for, here is the link. http://www.phpf1.com/product/php-photo-album.html[/url Link to comment https://forums.phpfreaks.com/topic/110680-php-based-image-display-manual/#findComment-567812 Share on other sites More sharing options...
DarkWater Posted June 18, 2008 Share Posted June 18, 2008 You could, if you wanted to do it yourself, pass the array key number in the URL and retrieve it with $_GET. Or, you could use a database. =P Link to comment https://forums.phpfreaks.com/topic/110680-php-based-image-display-manual/#findComment-567813 Share on other sites More sharing options...
kate_rose Posted June 18, 2008 Author Share Posted June 18, 2008 Thanks for the link. I will check it out. I do have a database in mysql. After the user completes a form saying what kind of pics they want to view php connects to mysql and assembles a list of the pics into an array. I am not sure how having a database helps me get any closer to the display part though. If you mean by storing the images in the database, I really don't want to do that because I have 100s of large images and it will make my DB enormous. Could you explain?? K- Link to comment https://forums.phpfreaks.com/topic/110680-php-based-image-display-manual/#findComment-567823 Share on other sites More sharing options...
DarkWater Posted June 18, 2008 Share Posted June 18, 2008 Instead of storing the array, which gets erased after every request (so it's a waste, basically), just pass the photo's ID in the URL on the links, and then check it in the database. Link to comment https://forums.phpfreaks.com/topic/110680-php-based-image-display-manual/#findComment-567828 Share on other sites More sharing options...
kate_rose Posted June 18, 2008 Author Share Posted June 18, 2008 The reason I am creating the array in the first place is because I don't want all the pics in my db displayed just some of them. My script gets the ones ordered by the user & sorts them into a specific order as requested by the user. The pics are of plants so all the flower pics for one species are stored in a single entry in the DB. The php script also explodes those entries. I guess I could create a new temporary DB & put my array into it. . . If I am misunderstanding please be patient this is my first try at a php script. K- Link to comment https://forums.phpfreaks.com/topic/110680-php-based-image-display-manual/#findComment-567843 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.