Hello,
I am trying to setup a file upload using the example from the PHP manual.
However, I am getting an Undefined index on userfile in the 2 places where
it is referenced. Can someone please tell me what this error means and why
it is happening?
Thank you,
Vic
Code Folows:
<?php
$uploadDir = '/var/www/uploads/';
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
}
else
{
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>