GrahamBoyd Posted January 27, 2010 Share Posted January 27, 2010 Hi everyone, I have a site where people can upload images and data. They can also edit the data and are supposed to be able to delete photos by unticking a checkbox, but it doesn't work - replacing the image works fine, but removing doesn't. Some help would be appreciated. Here is the image code complete - <? if($row_perdtl['imgfile1']!=0){?> <img src="images/thumbs/<?=$row_perdtl['imgfile1']?>" border="0"> <? }else{echo "No image available" ;}?> <input name="imagefilesame1" type="hidden" id="imagefilesame1" value="<?=$row_perdtl['imgfile1']?>"> </td> <td width="48%" height="60" rowspan="2" align="left" valign="middle"> <input name="image_no_change1" type="checkbox" class="textbox" id="image_no_change1" value="1" checked> <span class="table-text2">Select to keep this image or browse for a new image <br> </span> <br> <input name="imgfile1" type="file" class="textbox" id="imgfile1"> </td> Thanks in advance Quote Link to comment Share on other sites More sharing options...
GrahamBoyd Posted January 27, 2010 Author Share Posted January 27, 2010 I forgot to add the php code for uploading the image to the db - $preimage1=$_POST['imagefilesame1']; Quote Link to comment Share on other sites More sharing options...
teamatomic Posted January 27, 2010 Share Posted January 27, 2010 I would make it so they had to check the box to delete a photo. That way you just check of the value of the checkbox is 1 then you delete and skip the image_no_change stuff. HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.