PDA

View Full Version : How to improve PHP photo album script to upload photos?



Apple
07-31-2007, 06:11 AM
Hello,

I like PHP photo album script (http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm) and I'd like to use it on my website.

My page has form where user enters some information about some place. I want to rebuild page to allow user insert photo(s) from him gallery.

PHP photo album script will work fine with form, but how can I add "dynamic photo upload" feature to my page? I mean I can't reload page, so simple PHP will not work here, so I need some dynamic option.

I want do the following. User chooses some image from his hard drive, adds name of the photo and clicks Upload button. PHP script (I know how to build this one) uploads, resizes and saves image. Then new image appears in user's photo gallery. But if I refresh page, user will loose entered data (texts, labels etc). How can I do this without refreshing page?

Apple
08-01-2007, 01:17 PM
I have an idea to put image upload script to iframe, so the main page will not refresh after user will upload new image.

The question is how can I refresh PHP Photo Album script from this iframe? I mean user will upload new image and PHP script that will be in iframe should call some JS function to refresh images. Is that possible?

jscheuer1
08-01-2007, 01:39 PM
It might be easiest to go ahead and refresh the page. The values that were already entered by the user could be forwarded to the refreshed page using javascript and/or PHP.

Apple
08-02-2007, 01:39 PM
It might be easiest to go ahead and refresh the page. The values that were already entered by the user could be forwarded to the refreshed page using javascript and/or PHP.
I will try to use frames then. I think it will be more user friendly way. :)