VitalEnd Posted September 25, 2010 Posted September 25, 2010 Basically i have an upload avatar feature which uploads them to a file in my directory, this file is called Avatars. I would just like to know how i would put a query so a user could click the link saying "delete avatar" and it would delete that file from the avatars file, Possible or not? - Thanks Quote
Djkanna Posted September 25, 2010 Posted September 25, 2010 //get avatar from db //check if exists unlink('avatars/'.$fileName); //remove from db Quote
Dave Posted September 25, 2010 Posted September 25, 2010 $user_avatar = '/path/to/avatar/image.png'; unlink($user_avatar); Is that what you're after? That will remove the image.png file from that directory. Edit: Damn you DjKanna. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.