Here’s a little snippet from a script that lets a user upload a file…
if($ufile) // if file exists
{
copy($ufile, $dest); //copy it to the destination
unlink ($ufile); // delete temporary file
}
“ufile” is the name of the uploaded file field as specified in the html.
The $dest variable is constructed according to the type of file uploaded.
It works a treat… but ONLY if the php script is in the root directory, even thought the target path is properly specified.
I figure it must be something to do with the relative path of the temp upload directory.
Can anyone tell me how to specify that path (or even find it) so that the script will run from any directory on my website?
Thanks
CTB