Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting images off server using PHP

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Hi,

Is there a way in PHP to delete a file (eg: a jpeg image) off the server?

Thanks.
 
use the int unlink (string filename) function.

$file="/home/stuff/Copysendmail.jpg";
if (file_exists($file)) {
unlink("$file");
print "File deleted!";
} else {
print "file doesn't exists!";
}


cheers devnull22
(Knowledge Base Center )

--
Apparently if you play the Windows NT CD backwards you hear satanic messages. If you think that's bad, play it forwards and it installs Windows NT !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top