I create for each user a folder for his images, while checking the existence of the folder as follows:
$filpath = "img/p".$uId; if(file_exists($filepath) == '0'){mkdir("img/p".$uId);}
The first time a page with this code is accessed, a folder is created, but when it is repeated, it gives an error:
Warning: mkdir() [function.mkdir]: File exists in Z:\home\mysite.loc\www\setting.php on line 40
on line 40 is just a check.