Jump to content

Can anyone point me in the right direction for multiple image uploads


deansaddigh

Recommended Posts

I have a form, where admin can upload a school and its details, simple right?

On this form i want the user to be able to upload multiple images of a school.

Then when the form submits i want the image locations to be sent to the linker table image_school, which holds the school id and the image id.

 

Can anyone shed any light on how to do this please

The "input type=file" only accepts one file as an input, but you can get around this by including multiple file inputs in your form. You might even be able to accept a directory from the user and then enumerate their local files with javascript.

 

Once you have the form submitted to your php, you can access information about the files with the $_FILES array. I typed "php upload file" into google and found this tutorial as the first result:

 

http://www.tizag.com/phpT/fileupload.php

 

As for the database, that is simple once you have the file information. I don't know what type of database you are using, but you can find a tutorial on that just as easily.

 

Good luck!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.