I'm trying to upload files through my script. I have a form with the proper ENCTYPE, and it submits to my upload script:
function upload(){
if(!empty($_FILES["userfile"])) {
$uploaddir = "./";
if (move_uploaded_file($_FILES["userfile"]["tmp_name"], $uploaddir . $_FILES["userfile"]["name"])) {
echo("file uploaded");
} else {
echo ("error!");
}
}
}
this works fine except I have no idea where the file is going.
"I put a button on it, but I dare not press it for I don't know what it will do"
I've searched my computer for the file that I uploaded and all I can find is the original...
being as such, I can't really change the $uploaddir because I don't know where it's root is.. my htdocs folder, the script's folder, the drive root, on a seperate harddrive, or on some alternate plane of existance.