I am using JavaScript to upload images to a table on another page on the site. The current that I'm currently using looks like this.
<td width="10%">1</td>
<td width="10%"><?php if(file_exists('upload_folder/1.jpg')){ ?><img src="upload_folder/1.jpg" /><?php }else{ echo "No Picture";} ?></td>
<td width="60%">This is product number 1</td>
<td width="10%"></td>
<td width="10%"></td>
This code is great as long as I know in advanced, what the "product ID" is going to be, however the table is going to be updated at different times (and I don't know how many products there are going to be), so I won't know what the ID will be.
I would like it so that when an admin user uploads an image, they can put the image into a particular cell without knowing the product ID.
So far, I've tried using $productID = $_POST['productid']; and scandir(). however, these don't seem to work.
I hope someone, will be able to help, and that I haven't made this too confusing (I'm a little confused myself).