[thelist] PHP deleting a file
Matt Warden
mwarden at gmail.com
Wed Oct 12 06:59:23 CDT 2005
On 10/12/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");
> }
echo "Old photo: $oldphoto";
what does that output?
I suspect your $oldphoto isn't quite what you are expecting it to be.
--
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com
This email proudly and graciously contributes to entropy.
More information about the thelist
mailing list