|
|
 |
FN-FORUM: Can anyone help here
date posted 22nd July 2004 15:24
Hi,
Is there a php guru out there that could possibly help me with the
following.
I have a script which I include, this script is to upload images to a
specified directory. The user justs selects an image for a particular month
on the calendar, and then uploads an image for that month.
The problem is that I need the following. If the user decides that the imag=
e
they have uploaded is incorrect and wish to upload a new image, I need a wa=
y
of deleting the old image off the server. Now I have never done this before=
,
and I know you can use unlink. The problem is that the form contains the
name month1pic and I have a query to either not do anything if they just
click upload and not enter anything, or if they click upload to replace tha=
t
image. But if the image is not the same we have more than one image for a
month chosen. I have an mysql database which stores the image names, but I
need to delete the images not used.
Is there a way of doing this?
Here is my script below which uploads the image to the server or updates th=
e
image, you will notice I have not used unlink at all here, I have tried but
it fails.
--------------------------------------------------------
MY SCRIPT FOR ONE OF THE IMAGES
|
 |
|