View Single Post
  #4 (permalink)  
Old 12-13-03, 11:20 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

Thanks for clarification.

So this phpATM thing uploads files into one directory and add an info about this image into a text file (or whatever the extention it may be).

Then when you show the available downloads on another page, you read this file and display the names and corresponding links to them.

But the problem is that you want to show the files that are specifically requested - maybe something like this:

On the first page where you have a list of the files, users can click on a single image link that they want to view more details about. The link is something like a href="detail.php?id=123", and when the users arrive at detail.php, you want them to see only the image(s) that the parameter specifies, and not all of them). BUT because the file path/name are all in the text file that phpATM created and there is no database, you can't pass the criterion (i.e. $_GET['id']).

Is this correct?

If so, there are two ways to achieve this.

1) Store file path/name (upon uploading) into a MySQL table. If there can be more than one image that is associated with your PK, then use a separate table (i.e. one-to-many relationship, using the main table's PK as FK). This requires MySQL connection upon uploading, of course.

2) Depending on how this file created by phpATM is organized, you can try to "query out" those that are "associated" with your PK by reading the text file and compare it with the criterion. This will NOT require any database connection per se. If this is what you prefer, but don't know how to start with it, if you can give me a more specific example (especially how the text file is organized), I may be able to help you.

And finally, remember that there is no stupid question.
__________________
Blavv =|

Last edited by blaw; 12-13-03 at 11:24 PM.
Reply With Quote