i have a form for uploading files / images. I have no problem uploading and displaying the images , but i want to forward the images back to the same page that the imageas where selected, and use the POST data to place the image chosen in the 1st place , so the user can view and then if wanting to change the image for another.
The Problem i am having though is posting the flie back.
I have tried using it as a veriable and just using the variable to display an image but when i send that back to the image selection page, it does not display anything and if the user does not select a new image , the image data is not sent either..
i know im short cutting my explanation but i hope sum1 can help
here is my code (simplyfied)
THE INPUT FORM
<input type='file' class='fileinput' id='sellimage0' name='sellimage0' onchange='addimg0(this , img0, mainimage);' accept='image/*' /></input>
THE RECEIVER
if (!empty($_FILES['sellimage0']['name'])){
$image_path0 = $_FILES['sellimage0']['name'];
$image_path0 = filter_var($image_path0, FILTER_SANITIZE_STRING);
$image_path0 = strip_tags($image_path0);
$i0url=$image_path0;
} else {$i0url='';}
THE DISPLAY
<?php if (!empty($i0url)) { echo "
<div class='image0' id='image0' title='1st Image' >
<img id='img0' src='{$i0url}' class='imageclass'></img>
<input type='hidden' id='img0' name='sellimage0' value='{$_FILES['sellimage1']['name']}' ></input>
</div>
"; } ?>
THE POST BACK & RECEIVE
if (!empty($_FILES['sellimage0']['name'])){
$image_path0 = $_FILES['sellimage0']['name'];
$image_path0 = filter_var($image_path0, FILTER_SANITIZE_STRING);
$image_path0 = strip_tags($image_path0);
$i0url=$image_path0;
} else {$i0url='';}
<img id='img0' <?php if (!empty($i0url)) { echo " src='{$i0url}' "; } else { echo " src='' style='opacity:0;' "; } ?> onclick=' document.getElementById("sellimage0").click();' class='imageclass' ></img>
<div class='cancel' onClick='cancelimage(sellimage0 , img0);'> </div>
<div class='magnify' > </div>
<input type='file' class='fileinput' id='sellimage0' name='sellimage0' onchange='addimg0(this , img0, mainimage);' accept='image/*' /></input>
I hope this is making sense to you all.
i wish to choose an image, then post that choice to a view page
then from the view page , user has option to go back and edit
but how do i send the form data back to be received correctly so i can send the file back and forth between edit and review...
The way i have been trying just removes the selected images when i go back to the mainpage again.. iv tried many methods, but im lost on how to do this correctly.. Iv looked on the net to but finding my specific problem seems to be difficult.
Thank you.