wds Posted July 17, 2007 Share Posted July 17, 2007 i am very new to php, and i have only a basic knowledge/understanding. i am trying to start a photography business, and what i want to accomplish is to be able to dynamically create a gallery. the script will simply look in the folder i specify, display 20 photos per page, and allow the user to click each photo to enlarge it. what i want to know is what function is necessary in order to create the array of images? any other information/snippets which pertain to my goal would be appreciated. i've been searching the forum but have yet to find a similar post in relation to what i am trying to obtain. thanks, wds Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted July 17, 2007 Share Posted July 17, 2007 glob() <?php $i = 1; foreach(glob('/my/image/dir/*.jpg') as $imageName){ if($i<20){ echo '<img src="'.$imageName.'">'; }else{ break; } $i++; } ?> Quote Link to comment Share on other sites More sharing options...
wds Posted July 17, 2007 Author Share Posted July 17, 2007 how can i go about logging what page in the gallery i am in to determine which images to display? for instance lets say i have 100 images, when you first open the gallery, it display images 1-20, then when i click "next" it creates another page displaying images 21-40. i'm trying to figure this out using a form with the "get" method but as i said before, i am not well versed. ideas? furthermore, how can i increment/decrement a variable when the button is pushed? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.