displaying a directory of images and a form for each image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mikeyzc
Forum Newbie
Posts: 3
Joined: Wed May 26, 2004 12:00 pm

displaying a directory of images and a form for each image

Post by mikeyzc »

I'm working on a clients eCommerce website. He is selling vinyl graphics. He has over 246 libraries of images he wants to sell. Each library has about 50 images he can make and sell. Here is the file structure that im working with...

http://www.hisdomain.com/images/library001/001.gif
http://www.hisdomain.com/images/library001/002.gif
http://www.hisdomain.com/images/library001/003.gif

http://www.hisdomain.com/images/library002/001.gif
http://www.hisdomain.com/images/library002/002.gif
http://www.hisdomain.com/images/library002/003.gif

What I need to do is when someone clicks on a link to "library001" I need to display a page with a form consisting of an "add to cart" submit button and 3 textfields for each of the images in that library and also display the image with the form. I'm hoping there is an easy way to dynamically do this, so I don't have to create a form for each of the 12,000 items.
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

use a db to manage the libraries...don't neccessarily store the images in the db, but store the path to the images and the corresponding library as text

ie

graphics_table
id
library_id
image_name
other_details

then use a template page which allows users to browse the libraries. This links to the individual library (which is a page of thumbnails as links to the indivdual images)...and voila...

three pages to naigate the whole structure...

some index listing the libraries
library page showing the contents as thumbnails
details page showing the individual images

on all three pages you can have the add to cart links (on the index page, the user purchases entire libraries if thats what you want to happen, on the other two, individual images)

basic simple and clean...all sales are then stored in the db for tracking and historical information
mikeyzc
Forum Newbie
Posts: 3
Joined: Wed May 26, 2004 12:00 pm

Post by mikeyzc »

lostboy wrote:use a db to manage the libraries...don't neccessarily store the images in the db, but store the path to the images and the corresponding library as text

ie

graphics_table
id
library_id
image_name
other_details

then use a template page which allows users to browse the libraries. This links to the individual library (which is a page of thumbnails as links to the indivdual images)...and voila...

three pages to naigate the whole structure...

some index listing the libraries
library page showing the contents as thumbnails
details page showing the individual images

on all three pages you can have the add to cart links (on the index page, the user purchases entire libraries if thats what you want to happen, on the other two, individual images)

basic simple and clean...all sales are then stored in the db for tracking and historical information
that would be great but it's not really what im trying to accomplish. Basically I'm going to grab all the images from one of the libraries(directories), then i need to populate a page with thumbnails of all of those images. in addition to the thumbnails I'm going to have a form for each thumbnail. So essentially i will have a photo gallery with a form for each photo.

since the customer will be inputing their specs for the product they are purchasing the form will consist of 3 textfields and the add to cart button.
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

why? that is so much extra work for really nothing gained other than a page filled with forms...its simply not a logical or user friendly layout...
mikeyzc
Forum Newbie
Posts: 3
Joined: Wed May 26, 2004 12:00 pm

Post by mikeyzc »

lostboy wrote:why? that is so much extra work for really nothing gained other than a page filled with forms...its simply not a logical or user friendly layout...
The customer isn't buying the entire library. let's put it this way......

each image in the library is a certain style. The client chooses the style they like from the thumbnails. once they choose a style they complete the form located below the thumbnail the they press the add to cart button on the form and then it is done. tis way saves the customer steps in the purchasing process and will save me from doing data entry into a database for 12,000 items.
Post Reply