Hi All, I have been trying to create a php page that will upload a image, create a thumbnai and process a sql query, all automatically.
I have attached the two files. The form page (show-addrecord2.php) and the processing page (do_addrecord2.php).

The sql statement works fine. I am just having problems with the image upload and thumbnail creation part. I will also need the image and thumnail names to be added to the database as is in the sql query. I have tried a few things but cant seem to get it to work.

The problem seems to be at the point of upload.

I also should mention that the upload script is going to be in the admin folder of my script where the images will be in the images folder (not in admin/images - just /images). I hope you understand what I am trying to say. Also the links MUST remain reletive, just incase I install my script somewhere else.

Any help is greatly apreciated.

After a quick scan of your code, I suspect you are mixed up with two variables $newname and $image_name .

Forgive me if I'm wrong.

wulawula, The upload an thumbnail creation was taken form a tutorial that said it was supposed to work. I didn't test it before trying to integrate it into my script. So I don't know what the script should look like. I will continue to try different things though.

I actually have already read that thread, but was trying to get the script to do more. so, trying to make things easy, i downloaded one script that said it did what I wanted.

maxabet, I noticed something when going thru the other thread. The do_addrecord.php file that I uses a definition $img_name, but I don't see how or where that would be defined. Should I have a line near the top of the file that looks like this.

$img_name = $HTTP_POST_FILES;

I will go ahead and try it. The worst thing that could happen is it won't work.

i have an upload class if you want it. i created it to upload mulitple files and i also added a thumbnailing capability.

also $HTTP_POST_FILES is outdated. use $_FILES

kkieth29, I am interested in anything that will help me get this script going. Whether it is fixing this page or creating a new one. If you look at the do_addrecord.php page there is a couple of comment areas that specify where the image upload and processing script is. The important part is that the script is functional. I need the script to upload the image to (../images) folder and create a thumbnail and place that in the (../images/thumbs) folder. Then it needs to place the image and thumbnail images into the sql database.

Thanks for the help in advanced.

Does anyone have any help they can offer. I have tried a few things but can't get it to work. I'm stumped myself. Any Help is appreciated.

wow, sorry. been really busy with work. i will pm you the file as soon as i can.