mkdir ('users/'.$username); chmod ('users/'.$username, 0777); $sourcefile = 'users/'.$username.'/test.html'; fopen($sourcefile,'w+'); $file=fopen($sourcefile,'a'); fwrite($file,'deze user bestaat nu'); fclose($file);