$i = 3292;
move_uploaded_file($_FILES['doc_path']['tmp_name'], '../../../../uploads/documents/'.$i.'/'.$photograph);
move_uploaded_file($_FILES['doc_path']['tmp_name'], '../../../../uploads/documents/3292/'.$photograph);
上面的代码有什么问题。连接也是正确的但是当我使用$ i static时它工作正常。请帮助
答案 0 :(得分:0)
将路径存储在一个变量中并使用它。
$i = 3292;
$path = '../../../../uploads/documents/'.$i.'/'.$photograph;
move_uploaded_file($_FILES['doc_path']['tmp_name'], $path);
move_uploaded_file($_FILES['doc_path']['tmp_name'], '../../../../uploads/documents/3292/'.$photograph);