error gives me: Notice: Undefined index: userfile
made uploads folder CHMOD 777
PHP version: 4.4.6
i beleive there has been an update to the php version and there may be a change im not familiar with. Do i need to add a GET or anything to get the filename? im just stabbing in the dark now 🙂
here is my entire test form:
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="formtest_process.php">
uploadfile
<input type="file" name="userfile" />
<input name="submit" type="submit" value="submit" />
</form>
here is my entire process php file
<?
ini_set('display_errors', 1); // change to 0 once it's ready for production
error_reporting(E_ALL);
$uploaddir = 'uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
print $uploaddir . basename($_FILES['userfile']['name']);
}
?>
here is my output:
Notice: Undefined index: userfile in /home/fieldsol/public_html/admin/formtest_process.php on line 16
Notice: Undefined index: userfile in /home/fieldsol/public_html/admin/formtest_process.php on line 17
Notice: Undefined index: userfile in /home/fieldsol/public_html/admin/formtest_process.php on line 20
uploads/