OK just a little bit.
Yours 'variables' in the include file should be placed in an array so that you can loop over them, e.g.
$mynames = array("c1","c2","c3"...);
Then:
foreach($mynames as $name){
mkdir($name,0755,TRUE);
$existfile = "../content/" . $name . ".php";
$newfile = "$name/index.php";
if (!copy($existfile, $newfile)) {
echo "copy $file failed...";
}
}
Not tested, but that's the sort of thing I'd do. If you simply want to MOVE the files, use rename() instead of copy().
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080