Hi!
I can see you have some poor array indexes 🙂
$productfolder = "zips/$rowp[path]";
//should be
$productfolder = 'zips/'.$rowp['path'];
but im not sure thats the problem.
if the path 'zips/dir1/dir2' already exists an you only creates the 'newDir' your method shouldn`t be a problem.
But if it`s only the 'zips' directory that exists you should try this:
while ($rowp = mysql_fetch_array($res)) {
$folders = explode('/', $rowp[path]);
$productfolder = 'zips';
$zipFile = $rowp[zipfile];
foreach($folders as $folder) {
$productfolder.= '/'.$folder;
if(!is_dir($productfolder))
mkdir($productfolder, 0700);
}
copy('zips/vault/'.$zipFile, $productfolder.'/'.$zipFile);
}
I haven`t tested this, but i hope it helps.
Sorry for my poooor english..