Welcome Guest, Not a member yet? Register   Sign In
Delete folder
#1

hi , hi have a problem with folder deleting , this is my code :

Code:
        //carico l'helper
        $this->load->helper("file"); // load the helper

        //percorso della cartella
        $path='/uploads/'.$id_user.'/';

        //rimuovo i file
        if(! delete_files($path, true) ){

            $errori++ ;
            $data['messaggi_errore'] = $data['messaggi_errore'].' Problemi eliminazione file |';

        }

        //rimuovo la cartella
        if( rmdir($path) ) {

            $errori++ ;
            $data['messaggi_errore'] = $data['messaggi_errore'].' Problemi eliminazione cartella |';
        }

The file inside the folder are correcting delete but i have this warning :

Message: rmdir(/uploads/33/): No such file or directory

But in uploads i have the folder 33 ...
Reply
#2

Remove the trailing slash:
PHP Code:
$path='/uploads/'.$id_user;
rmdir($path); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB