well I don't see anything wrong in the code, but im probably looking right over the problem. here is the upload function. function upload(){ echo "step1<br/>"; $path = "img/" . $_GET['id'] . '/' .rand(11,99). $HTTP_POST_FILES['ufile']['name']; if($ufile != none){ echo "step2<br/>"; if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path)){ echo "step3<br/>"; chmod($path, 0777); } } else { echo'<span style="color:red">Upload Failed</span><br/>'; } } PHP: and it is returning step1 and step2, but not step3 so something somewhere is going wrong. before i completely re-write this, does any of you see a problem? thanks!
can you post the form? -> $HTTP_POST_FILES['ufile']['name'] -> $_GET['id'] are these existing? make sure you pass this globaly into the function.. i dont see any parameters in your function
<form method='post' action='?act=modify&id=$id' enctype='multipart/form-data'>Add Image <input type="file" name="ufile"/><input type="submit" value="Upload" name="upload"/></form> PHP: and the id variable is always set, and i made sure it was being put into the form action correctly which it was.
Cant find the error but regarding this part : $ufile is? Did u assign a value to it? I see its a function and there isn't anything assignation regarding $ufile $ufile = $HTTP_POST_FILES['ufile']['name']; // maybe if($ufile != ''){ PHP: Anyway this is not the problem as it prints out step2 Try rename instead of copy.