Hi there, I have a problem and doesn't know why it comes:
In the first page, i have similar code likes this:
if ($HTTP_POST_FILES["upload_file"]["name"] != "") {
$temp_array = array("name"=>$FILES["upload_file"]["name"],"tmp_name"=>$FILES["upload_file"]["tmp_name"],"size"=>$FILES["upload_file"]["size"],"type"=>$FILES["upload_file"]["type"]);
$_SESSION['upload_array'][] = $temp_array;
for ($i = 0 ; $i < count($_SESSION['upload_array']) ; $i++) {
print $_SESSION['upload_array'][$i]["name"]." <a href='javascript:removeAttachment(".$i.")'>[Remove]</a>"."<br>";
copy($_SESSION["upload_array"][$i]["tmp_name"], $_SESSION["upload_array"][$i]["name"]);
}
}
The copy function is fine.
But users click the submit button and some data post to other page. I run this code:
copy($SESSION["upload_array"][$i]["tmp_name"], $SESSION["upload_array"][$i]["name"]);
It wouldn't work anymore. Why?