I am having trouble getting an html edit page for to work, a script basically, I want to show an image and abelow have the option to delete it and upload another image. I can edit the text and the images stored show ok but I have the following problems:-
The delete works fine as does showing the image but the upload doesn't work.
Image display, delete and upload script.
<? if(strlen($photo1) > 1)
{
echo "<img src=$photodir$photo1 width=100 name=photo_1 value=$photo1><br>".
"<input type=checkbox name=photo1_del value=1>".
" Delete above image";
}?>
<input type="file" name="photo_1" size="40" maxlength="80">
The delete image script works.
if($_POST['photo1_del'] == 1)
{
unlink($photodir . $photo1);
$photo1 = '';
}
Photo upload script, I use the same one in a 'add' form on the same site and that works great.
if($HTTP_POST_FILES['photo_1']['size'] > 1)
{
copy($HTTP_POST_FILES['photo_1']['tmp_name'], $photodir.$HTTP_POST_FILES['photo_1']['name']);
$photo1 = $HTTP_POST_FILES['photo_1']['name'];
}
Any help would be greatly appreciated.