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 Link to comment https://forums.phpfreaks.com/topic/189953-checkbox-problems/ 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']; Link to comment https://forums.phpfreaks.com/topic/189953-checkbox-problems/#findComment-1002243 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 Link to comment https://forums.phpfreaks.com/topic/189953-checkbox-problems/#findComment-1002250 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.