php - Making a directory based on username? -
i trying create directory mkdir code. when use code :
mkdir("test");
then, "test" directory created. when try this
mkdir($_session['username']);
then, got error saying
warning: mkdir(): open_basedir restriction in effect. file() not within allowed path(s)
what mean? tried
$path = $_session['username']; mkdir($path);
and
mkdir("".$_session['username']."");
but gives me same error message. supposed do?
make sure prefix folder name full path want create folders. ie, if trying create folders under /tmp/users
might use code like:
mkdir('/tmp/users/' . $_session['username']);
you need make sure have configured php allow access path. see open_basedir ini directive: http://php.net/manual/en/ini.core.php#ini.open-basedir