move_uploded_file issue
<p>I am trying to figure out how the file upload system works in PHP. My code is:</p>

<pre><code>if(isset($_FILES['profile_pic'])){
    $allowed_ext= array('jpg','jpeg','png','gif');
    $file_name = $_FILES['profile_pic']['name'];
    $file_ext = strtolower(end (explode('.',$file_name)));
    $file_size = $_FILES['profile_pic']['size'];
    $file_tmp = $_FILES['profile_pic']['tmp_name'];
    if(in_array($file_ext, $allowed_ext) === false || $file_size &gt; 2000000){
        $display_block = 'display:block !important';
        $pic_errors ='&lt;p&gt;*  File format JPG, JPEG, GIF or PNG&lt;/p&gt; &lt;p&gt;*  Smaller 1Mb&lt;/p&gt;';
    } else {
        move_uploaded_file($file_tmp, '/members/');
        echo 'uploaded..';
    }
}//if(isset($_FILES['profile_pic']))
</code></pre>

<p>with permissions everything seems to be fine.</p>

<p>The error I get is:</p>

<blockquote>
  <p>Warning: move_uploaded_file(/members/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home/a6671212/public_html/settings.php on line 116</p>
</blockquote>

<p>How do I fix this error?</p>

<p>THANKS to everyone..</p>

<p>as i understood i had 2 issues..</p>

<ol>
<li><p>as @Prisoner wrote..
move_uploaded_file($file_tmp, '/members/'); - i didn't wrote the file name after /members/</p></li>
<li><p>as @Ketan Patel wrote,</p></li>
</ol>

<p>the function should be changed to another format, if i may say so..</p>

<p>move_uploaded_file($file_tmp, "/members/$file_name"); - double quotes...</p>

<p>It Worked!!!!!!!! Thank YOUUU!!!</p>
