Hi,
I have a simple problem that I just can't get right. I have a site that sells photos. The photos appear on PHPSimpleGallery with the file name as the photo's name. I need some sort of script that, if the user select the photo (via a button or something) that filename must be added to a list that will be emailed to the client. Some of the galleries have upto 400 photo's uploaded at one time so I can't use the convensial MySQL catalogue or cart scripts, any ideas on how to make this possible?

Thanx in advance

list the images in thumbnails, 30 images / page

if the user like the image, make a link to each image to add to a cart (session variable)

then build an image to tell the user, send to the client/friend or something you need.

this needed an image lister with simple thumbnail function.

Member Avatar for diafol

Perhaps placing images into a zip file would also help (only one file attachment). The image filenames can be added to a session array (as mentioned above). However, it may be best to store the file 'ids' in the array until you need to output to zip.

How do I get the filename in PHP and add it to a list.

Member Avatar for diafol

An ajax call would be good for this - click a link - send an id value to a js script which sends the id to a php script where the id is added to a session array variable, e.g $_SESSION. No other data needs to be included until checkout, unless you want to give a running total of the cost. The ajax php script could search the db for a price OR you could pass the price along with the id to the javascript button (I wouldn't advise this method).

In a real app, you'd need to create a js 'event listener' to deal with link/button clicks, but you can experiment with the much-maligned inline 'onclick' attribute. If you're actually using this site to take money, just be careful.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.