how to upload a file with variable name
<p>I have a problem with uploading file,
 I am Using this code......
and getting this error,</p>

<p>my folder name is garment_images</p>

<pre><code> &lt;?php
    $pid          = mysql_insert_id();
    $folder       = $_post['catagory'];
    //insert images into folder
    $product_name = "$pid.jpg";
    move_uploaded_file($_FILES['productImage']['tmp_name'], "$folder._images" / $product_name);
    echo "&lt;h1&gt;Your product successfully added &lt;br /&gt; Plese wait....&lt;/h1&gt;";
    header("refresh:3; url='inventory.php'");
    exit();
    ?&gt;
    &lt;form method='post' action='index.php'&gt;
    &lt;input type="file" name="productImage" /&gt;
&lt;input type="text" name="catagory" /&gt;
    &lt;/form&gt;
</code></pre>
