Can anyone tell me why I keep getting the error message " Warning: Unable to open '' for reading: No such file or directory in /usr/local/WEB/ben/multiples/upload.php on line 22"
the directory exists, and has the appropriate ownership rights. here is my script:
<?
function show_form()
{
echo "<form action=\"upload.php\" method=\"post\" enctype=\"multipart/form-data\">";
echo " Send these files:<br>";
echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"10485760\">";
echo " <input name=\"userfile1\" type=\"file\"><br>";
echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"10485760\">";
echo " <input name=\"userfile2\" type=\"file\"><br>";
echo " <input type=\"submit\" name =\"action\" value=\"upload\">";
echo "</form>";
}
function upload_files()
{
for($i=1; $i < 3; $i++)
{
print $i;
$varname = "userfile".$i;
$varname_name = "userfile".$i."_name";
print $$varname_name;
if ($$varname != "none")
{
copy ($$varname, "/usr/local/WEB/ben/multiples/".$$varname_name);
}
}
}
switch($action)
{
case('upload'):
upload_files();
break;
default:
show_form();
}
?>
Any help would be appreciated.