[thelist] PHP deleting a file
Liam Delahunty
liam at megaproducts.co.uk
Wed Oct 12 06:01:11 CDT 2005
On 12/10/05, Jeremy Weiss <jweiss at cox-internet.com> wrote:
> I'm needing some help with the following PHP script. I'm trying to check and
> see if $oldphoto is equal to nophoto.gif. It if is equal I want it to do
> nothing. Otherwise I want it to delete $oldphoto. The problem is, it deletes
> $oldphoto either way.
>
> if ($oldphoto != "nophoto.gif") {
> // Delete the agents existing photo
> @unlink("$oldphoto");
> }
>
Does nophoto.gif exist?
Have you tried the full path to the image?
What errors do you get if you remove the error suppression? (@)
kr,
Liam
More information about the thelist
mailing list