I have an edit form that contains images path.
On that form you can choose to edit existing image or not.
However, if you decide not to change image, and do not do an upload, submitting the form wipes out current image. What am I doing wrong?
if (is_uploaded_file($thumb))
{
copy ($_FILES['thumb']['tmp_name'], "/var/www/html/tools/images/thumbs/".$_FILES['thumb']['name'])
or die ("image exists");
$newthumb="/images/thumbs/".$_FILES['thumb']['name'];
}
I also tried
$thumb=$_POST['thumb'];
if (is_uploaded_file($thumb))
{
copy ($_FILES['thumb']['tmp_name'], "/var/www/html/tools/images/thumbs/".$_FILES['thumb']['name'])
or die ("image exists");
$newthumb="/images/thumbs/".$_FILES['thumb']['name'];
}
else {
$newthumb=$thumb;
}