Hi there. I'm trying to write a .inc file that contains a function that will upload a file. The problem is that I have to pass the $_FILES arrary to the function... do I just use $_FILES[] as a parameter and as a second parameter sent the actual value of the filename input box? So I would have the $_FILES[] array and the filename I need to reference all passed to the function... does this sound like it would work or does the file upload stuff have to be done outside a script?
This is how I am calling my function which is in an included file:
$returnvar=upload_single_file($_FILES[],$_POST[vlu]);
This is the function declaration:
function upload_single_file($filesarray,$filename {....}
and this line will not work in the function, I assume because it really does not have the $_FILES array...
basename($filesarray['$filename']['name']);
Is what I am trying to do even possible? Works if the code is not in a function and just in the php page.
Thanks,
Suave
This is how I am calling my function which is in an included file:
$returnvar=upload_single_file($_FILES[],$_POST[vlu]);
This is the function declaration:
function upload_single_file($filesarray,$filename {....}
and this line will not work in the function, I assume because it really does not have the $_FILES array...
basename($filesarray['$filename']['name']);
Is what I am trying to do even possible? Works if the code is not in a function and just in the php page.
Thanks,
Suave