Page 1 of 1

How to upload an image, save it on the server and store its?

Posted: Mon Feb 12, 2007 5:36 am
by Betty_S
Hallo everyone!

I wont to add php/html code which can do that:

Let the user choose and upload a file (an image), save the file on the server and store its location into a mysql table.

If you have an example code or a link that would be super!

I know how to handle the html part but I have no idea whatsoever what to do with the path I get from the user!

Please help me.

Thanks.

Posted: Mon Feb 12, 2007 5:49 am
by Chris Corbyn
The information is stored in $_FILES["your-form-field-name"] once the file has been uploaded.

Use move_uploaded_file() to move it where you want, then add that to the DB.

http://uk.php.net/manual/en/features.file-upload.php