I’m making an administration page for a website. Currently, it allows a user to see a set of “products” which they can delete, edit, or add to (create new). Addition and editing both work by allowing the user to fill out/edit values on a form which is presented on top of the screen using some javascript/css.
The issue that I’ve run into is that I need to allow the administrator to select an image to associate with the product they’re creating or editing with this form. To make things easy for now, let us assume that all selectable images are already held in the folder “ROOT/images”.
How can I provide a nice interface for the user to select an image from the server on this form? I can’t send all the images down with the webpage in advance in case there end up being thousands, and I don’t know how to let the web page on the client side access things on the server side through javascript.
I’m restricted to using {PHP/MySql/JavaScript (w/ jQuery if I need it)/HTML/CSS} – can anyone give me an idea on how to accomplish this task, or what the common alternate way around this problem is?
You’re basically asking for a directory listing that is available via javascript.
So you could write a PHP script that lists the images as an json encoded array.
That script could handle additional actions like search and paginate, so you don’t need to transfer too much data (at once).