my project needs folder to be created whenever user registers using userid inside upload folder so i'm using below lines but its not creating any new folder inside upload folder with userid
$userid = $this->db->insert_id();
$path = './upload/'.$userid;
if(!is_dir($path)) //create the folder if it's not already exists
{
mkdir($path,0755,TRUE);
}
PS: i am using wamp server and ci..
thanks
you should try this code
chmod('./upload/', 0777);
$path = './upload/'.$userid;
if (!is_dir($path)) { //create the folder if it's not already exists
mkdir($path, 0755, TRUE);
}
upload dir path for CI
$path = './upload/'.$userid;
You should use a full path to create a directory and also the upload folder should have the right permissions to create dir's and files in it.