php bit more dynamic and clever?

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Thu Jul 01, 2010 2:50 pm

php bit more dynamic and clever?

Postby rob1 » Tue Nov 16, 2010 12:55 pm


im fairly new to php and ive recently started building my own image gallery so i can effectively store and search my ever growing photo collection and i got just two quick queries I was wondering if anyone could help me with?

Im using mysql for my DB and the image ID is what im renaming the jpg images.

1, uploading of a picture using normal web form input field to upload, as i cant think of any other easy way of doing this at the moment?

what i would ideally like to do is once the image has been selected then it gives you a preview next to the field so you can double check it is the correct image that you have selected.

maybe this would prove more useful if i were to later on read a folder on the pc to mass upload?

2, keywords/searching ? i know i need to use a many to many relationship when creating the database tables, but im left wondering what is the best way to actually 'tag' these images with keywords and from a user/admin point of view how can i make it easy/manageable to maintain ?

i had initially thought of using tick boxes which could be dynamically created by looping through the keyword table and then the user could select/submit the keywords associated to the shown image. The other option i had considered was a multi-select drop down box - but it seemed to be more messy and less user friendly.

does anyone have any thoughts on the above project/problems im presented with?



New php-forum User
New php-forum User
Posts: 139
Joined: Mon Nov 15, 2010 12:11 am

Re: php bit more dynamic and clever?

Postby lokanath7 » Wed Nov 17, 2010 2:12 am

there are two ways of solving ur 1st problm.
1-> u can use ajax to submit the img temp_name and then upload it when choose "browse" btn and can show a preview from the folder where the original img is uploaded.
bt it is a bit difficult.

2-> u can write a iframe(display none) which is the target of a form containing the img file.
then u can write a fnc onchange() of input type file where u can get the name of the file and submit the form and in another php file u can get the post value ie name of the img and upload it to a folder and use it...

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest