Posted by Krustov on 07/12/06 18:43
<comp.lang.php>
<Frankie>
<Wed, 12 Jul 2006 18:36:01 GMT>
<libtg.6765$ye3.5139@newsread1.news.pas.earthlink.net>
> I'm coding a website which allows the owner to make add/change/deletes to
> his product database, which includes product images stored separately on the
> server. I have coded the Delete page which deletes the product record from
> the database, however the product image remains in the associated folder on
> the server. I'd prefer these images not accumulate and would like to delete
> these images along with the database record.
>
> Can anyone refer me to a PHP script or suggest a way to do this?
>
$pass=0;
$filename="images/whatever.jpg";
if (!file_exists($filename)) {$pass=1;}
if ($pass==1) {unlink($filename);}
unlink() is a silly name for a delete command isnt it .
--
Encrypted email address
www.emailuser.co.uk/?name=KRUSTOV
[Back to original message]
|