I made a form that inputs text into a database, title, email, description, four image names, four thumb image names, and a confirmation code called status. This form has four file input prompts.
After clicking the submit button the forms (action= preview page) opens a preview page. The preview page processes the images in an array like fashion, limiting file size and type, reducing image size, making a thumb copy and reducing that copy down further, then inputting the image names and other info into a table. The preview page then displays the info and images along with an edit button.
The user can click the edit button to go back. The form now displays three radio buttons next to each file input prompt.
Keep, delete, replace. I coded keep and delete, but I am having trouble with replace. When a radio button is selected there is a value I can use to differentiate which file input prompt or image is being chosen. This allows me to keep or delete the correct image. To replace an image there is a replace radio button, but in addition to this the browse button must be used to select a different image. I have no way to identify which file upload prompt was selected. I am new to php. I need some ongoing help with this form. There is probably more than one way to do this and I am open to suggestions if you can help me get there.
A person in a discussion group suggested I just have two radio buttons, delete yes and delete no. The table would be queried. If an image name was deleted (returned a true value), then the image file would be deleted. The file input prompt would always default to replacing the image if a new image had been browsed and the submit button clicked regardless of the radio button position.