PHP Code:
if ($action == "load") {
if(!empty($_FILES["userfile"])) {
$uploaddir = $home . $path . $_FILES["userfile"]["name"];
//Copy the file to some permanent location
if(move_uploaded_file($_FILES[userfile]["tmp_name"], $uploaddir)) {
echo 'The file was uploaded successfully! Please click <a href="?path='.$path.'">here</a> to continue.';
} else {
echo 'An error occured while trying to upload the file! Please click <a href="?path='.$path.'">here</a> to return to the File Manager.';
print_r($_FILES);
}
} else {print_r($_REQUEST);}
} else {
echo '<form method="POST">
<input type="hidden" name="action" value="load" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Upload" />
</form>';
}
}
I get the Request data(will be taken out once the scipt works) instead of a conformation message.
Im doing something wrong, but i dont know what.
PS: "$_FILES" is not empty, b/c i get this...
Array ( [path] => upload/ [act] => load [action] => load [userfile] => /home/boxxertrumps/snapshot1.png )
Bookmarks