note 14175 rejected and deleted from function.unlink.php by zak
| From: | zak@php.net | Date: | Fri, 20 Jul 2001 03:57:58 +0000 |
| Subject: | note 14175 rejected and deleted from function.unlink.php by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15604@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