Help with image/description uploading
Posted 08 June 2006 - 11:11 PM
Posted 08 June 2006 - 11:41 PM
for each new car, you make a directory with the car name (for example hona_civic)
When he uploads the images (each car pictures will go into its' own folder) save them with specific names (like pic_1.jpg pic_2.jpg, pic_3.jpg etc)
and save the description as files in the same folders (like desc_1.txt, desc_2.txt, desc_3.txt)
This way each picture will have it's own description.
Hope this helps.
Posted 08 June 2006 - 11:46 PM
That was the idea I had going a while ago, but what he wants would be 5 pictures on a page (like in a directory folder like you said) and the description will appear at the bottom of the pictures. Now I'm wondering if there's any possible way that if when he saves the description like you said in a .txt file in the same directory, I can code something that will call in that description on the bottom of the page (almost like an include). What would you think?
Posted 09 June 2006 - 12:55 AM
$desc = file_get_contents('desc_1.txt');and then echo it wherever you want. You could loop through the images in the directory, incrementing a variable such as $i as you go and then just use it to match the picture to the text. So if you were on pic_3.jpg, $i would also be at 3 and then you can just echo file_get_contents('desc_' . $i . '.txt');
Don't worry, the printer fairies will sort it out.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users