Trying to execute file upload through external function. It gives "Missing argument..." error but also returns the result correctly. What might be wrong?
This is form page:
<?php include '--formprocess.php'; ?>
<?php
if($_SERVER['REQUEST_METHOD'] === 'POST') {
$upload = $_FILES['upload'];
if(formprocess($upload)) {
echo formprocess();
} else {
echo 'ERROR!';
}
}
?>
and process file:
<?php
function formprocess($upload) {
$name = $_FILES['upload']['tmp_name'];
return $name;
}