PHP simple file upload form doesn't work
<p>I'm exploring the file upload and text parsing capabilities of PHP, but my first step is buggy, and I can't figure it out.  The goal of the code is to display a form to upload a text, and then display the value of the corresponding <code>$_FILES</code> array.  However, it doesn't work - it runs without error but doesn't display <code>print_r($_FILES['upload'])</code>.  What am I missing?</p>

<p>This is my <code>Index_txtParsing</code> file:</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
    &lt;head&gt;
        &lt;title&gt;test&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form enctype="multipart/form-data" class="Txt_upload" method='POST'  action='index_txtParsing.php'&gt;
            &lt;label for="file"&gt;Enter upload here:&lt;/label&gt;
            &lt;input type='file' name='upload'/&gt;
            &lt;input type='submit' name='submit' value="upload here"/&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;

&lt;?php
    if(isset($_POST['upload'])){
    $upload=$_POST['upload'];
    print_r($_FILES['upload']);
    }else{
    $upload="unknown";
    }
?&gt;
</code></pre>

<p>EDIT: After incorporating the recommendations below, this code works:</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
    &lt;head&gt;
        &lt;title&gt;test&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form enctype="multipart/form-data" class="Txt_upload" method='POST'  action='index_txtParsing.php'&gt;
            &lt;label for="file"&gt;Enter upload here:&lt;/label&gt;
            &lt;input type='file' name='upload'/&gt;
            &lt;input type='submit' name='submit' value="upload here"/&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;

&lt;?php
    if(isset($_FILES['upload'])){
    echo "Value of FILES['upload'] ";
    print_r($_FILES['upload']);
    echo "&lt;br/&gt;";
    }else{
    }
?&gt;
</code></pre>
