Can't access $_POST variables when using multipart/form-data
<p><strong>What is the problem?</strong></p>

<p>When I add a file using my form the $_POST variables are undefined. When I don't add a file the $_POST variables are defined.</p>

<p><strong>What errors do you receive?</strong></p>

<pre><code>Notice: Undefined index: bbmpin in C:\...\addpin.php on line 6
Notice: Undefined index: usermsg in C:\...\addpin.php on line 7
</code></pre>

<p><strong>Source Code</strong></p>

<p>index.html</p>

<pre><code>&lt;form method="POST" action="addpin.php"  enctype="multipart/form-data"&gt;
        &lt;div&gt;
            &lt;label for="bbmpin"&gt;Your BBM Pin&lt;/label&gt;
            &lt;input type="text" name="bbmpin" placeholder="Enter Your BBM Pin"&gt;
        &lt;/div&gt;

        &lt;div&gt;
            &lt;label for="usermsg"&gt;Message&lt;/label&gt;
            &lt;input type="text" name="usermsg" placeholder="(optional) Add a short message" maxlength="255"&gt;
        &lt;/div&gt;

        &lt;div&gt;
            &lt;label for="image"&gt;Upload Image &lt;small&gt;(optional)&lt;/small&gt;&lt;/label&gt;
            &lt;input type="file" name="image"&gt; 
        &lt;/div&gt;

        &lt;button type="submit"&gt;Submit&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p>addpin.php</p>

<pre><code>&lt;?php
session_start();

require_once('config/config.php');

$pin = $_POST['bbmpin'];
$msg = $_POST['usermsg'];
$ip  = $_SERVER['REMOTE_ADDR'];

print_r($_POST);
print_r($_FILES);
    exit;

    ...
?&gt;
</code></pre>
