$result = $db->query("SELECT * FROM ".TABLE_PICS." ");
while($r = $db->fetch_array($result)){
$ps1 = explode('/',$r[pic1]);$ps2 = explode('/',$r[pic2]);$ps3 = explode('/',$r[pic3]);
$picture1 = "upload_files/".$r[pid]."/".$ps1[3];
$picture2 = "upload_files/".$r[pid]."/".$ps2[3];
$picture3 = "upload_files/".$r[pid]."/".$ps3[3];
$folderdir = HOME_ROOT."upload_files/$r[pid]/";
if(!file_exists("$folderdir/.")) @mkdir("$folderdir/.");
$file1 = HOME_ROOT."$r[pic1]";$file2 = HOME_ROOT."$r[pic2]";$file3 = HOME_ROOT."$r[pic3]";
$to_file1 = HOME_ROOT."$picture1";$to_file2 = HOME_ROOT."$picture2";$to_file3 = HOME_ROOT."$picture3";
copy($file1,$to_file1);copy($file2,$to_file2);copy($file3,$to_file3);
$db->query("update ".TABLE_PICS." set pic1 = '$picture1',pic2 = '$picture2',pic3 = '$picture3' where uid = '$r[uid]'");
}
图片转移
最新推荐文章于 2019-05-20 11:34:24 发布