Jump to content

Trouble uploading files --Notice: Undefined index:


Pacopag

Recommended Posts

Hi.  This is my first post, so feel free to lecture me on forum etiquette and conventions.  I'm trying to create a form, several items of which are file upload <input>s.  Here is the relevant code from the form.

 

<label for="facefile">Filename:</label>

<input type="file" name="facefile" id="facefile" />

 

This form has an action="validateform.php".

In the file for validateform.php I can't seem to reference "facefile".  I just try doing

 

<?php echo($_FILES["facefile"]["name"]); ?>

 

And I get

 

Notice: Undefined index: facefile in validateform.php on line 1

 

The code seems so transparent that I think that there must be a problem with something other than the code.

 

Maybe Apache is not configured right?

 

I've seen similar posts to this where the poster said it was a problem with php.ini.  But he didn't give any details.

Add the following and post the output after the form has been submitted.

echo 'POST array:<pre>';
print_r($_POST);
echo '</pre>FILES array:<pre>';
print_r($_FILES);
echo '</pre>';

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.