php - mkdir() not working with this code for creating random directory name for upload photo -
// profile picture upload if (isset($_files['profilepic'])) { if ( ((@$_files["profilepic"]["type"]=="image/jpeg") || (@$_files["profilepic"]["type"]=="image/png") || (@$_files["profilepic"]["type"]=="image/gif")) && (@$_files["profilepic"]["size"] < 1048576) ) //1 megabyte { $chars = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789"; $rand_dir_name = substr(str_shuffle($chars), 0, 15); mkdir("userdata/profile_pics/$rand_dir_name"); this directory files are: c:/xampp/htdocs/asweb and want keep new directory: c:/xampp/htdocs/asweb/userdata/profile_pics i tested following: $chars = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789"; $rand_dir_name = substr(str_shuffle($chars), 0, 15); echo $rand_dir_name.$b; // ojtxnh...