I want to link multiple fileuploads with checkboxes in php.
this is what i have:
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]" value="1"> linked to file-upload 1 <br/>
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]" value="1"> linked to file-upload 2 <br/>
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]" value="2"> linked to file-upload 3 <br/>
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]" value="3"> linked to file-upload 4 <br/>
I want to do something when a file is uploaded and the related checkbox is checked in PHP,
how do i link the file input type with the checkbox?
You could combine them under one name array.
Which can be accessed in php with:
$_REQUEST['combined'][1]['file']