VitalEnd Posted September 25, 2010 Share 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 Link to comment Share on other sites More sharing options...
Djkanna Posted September 25, 2010 Share Posted September 25, 2010 //get avatar from db //check if exists unlink('avatars/'.$fileName); //remove from db Quote Link to comment Share on other sites More sharing options...
Dave Posted September 25, 2010 Share 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 Link to comment Share on other sites More sharing options...
Djkanna Posted September 25, 2010 Share Posted September 25, 2010 Hehe Quote Link to comment Share on other sites More sharing options...
VitalEnd Posted September 25, 2010 Author Share Posted September 25, 2010 Ah great, thanks guys :D Quote Link to comment Share on other sites More sharing options...
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.