Welcome Guest, Not a member yet? Register   Sign In
How to delete folder according to username.

(This post was last modified: 07-03-2018, 07:17 AM by kirasiris.)

I have a register form in which users can registers to create their own account in my application and I'm giving them the oportunity to upload their own pictures etc. Everything works well so far.
The problem comes when the user and/or admin deletes an user account. For example I as an admin, I decide to delete Brian's account, all of his folders should be deleted as well.

This is the current path:


the naming of the folder by username works great but when deleting the account instead of just deleting his/her folders(whether is within avatars/covers/status), it deletes the whole path, resulting on this(notice there are not avatar/covers/status folders now):


This is what I have in my model:
PHP Code:
   public function delete($id)

       // If users closes his account, all of his folders should be deleted as well
       $item $this->get($id)->username;

I hope someone can  help me.

Thanks in advance.
I do Front-End development most of the time 

Messages In This Thread
How to delete folder according to username. - by kirasiris - 07-03-2018, 07:14 AM

Theme © iAndrew 2016 - Forum software by © MyBB