note 14175 added to function.unlink.php
| From: | bclampitt at mail dot com | Date: | Fri, 20 Jul 2001 02:11:17 +0000 |
| Subject: | note 14175 added to function.unlink.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15602@lists.php.net to get a copy of this message | ||
I have a question that pertains to this function for *nix
I am using a form to have a picture uploaded to a folder and the $picture_name put in the database
to be called by other scripts. So if they (whoever) decided to use the same form and upload another
picture it will upload the new picture and put in a new value in the database... so this is the
command I need to delete the old image, so that my hdd does not get cluttered. well would this work?
unlink("$picture /root/folder/to/images/$picture_name");
exec("cp $picture /root/folder/to/images/$picture_name");
where it will delete the old value first, then upload the new one?
or does this have to be done before it querys the database... or will it work at all?
either reply or email me please.. thanks :)
Brad
http://www.php.net/manual/en/function.unlink.php