move_uploaded_file() function doesn't work while referencing to another page
<p>I have problem with move_upload_file() function while referencing it to another page. It works without any mistakes. But the problem is the selected file is not being transferred to the specified directory. </p>

<p>I din't know what's the problem and appreciate any kind of help or suggestions.</p>

<p>Here is the code:</p>

<p>PAGE 1(where input is being done):</p>

<pre><code>    &lt;form name='NewsForm' method='post' action='conf_news.php' enctype='multipart/form-data' &gt;

 &lt;input type="file" name="file" id="file" value='' &gt;
 &lt;input type='submit' name='AddNews' value='POST' &gt;

 &lt;/form&gt;
</code></pre>

<p>It brings code to another page "conf_news.php" where i reference parts of the stored file:
PAGE 2:</p>

<pre><code>     $PicMessage = "";
    $PicName = addslashes( $_FILES["file"]["name"] );
    $PicType = addslashes( $_FILES['file']['type'] );
    $PicSize = addslashes( $_FILES['file']['size'] );
    $PicError = addslashes( $_FILES["file"]["error"] );
    $PicTempName = addslashes( $_FILES["file"]["tmp_name"] );

$allowedExt = array('jpeg', 'jpg', 'gif', 'png');
$a = explode(".", $PicName);
$extension = end($a); unset($a);

if((($PicType == "image/gif") 
|| ($PicType == "image/png") 
|| ($PicType == "image/jpeg")
|| ($PicType == "image/jpg") 
&amp;&amp; ($PicSize &gt; 100)
&amp;&amp; in_array($extentions, $allowedExt))){

   if($PicError &gt; 0){
       $PicMessage = "Error Type: ". $PicError. "&lt;br /&gt;";
   }

    else{
       echo "Upload: ". $PicName. "&lt;br /&gt;";
       echo "Type: ". $PicType. "&lt;br /&gt;";
       echo "Size: ". ($PicSize / 1024). " Kb&lt;br /&gt;";
       echo "Stored in: ". $PicTempName;


       if(file_exists("../photos/". $PicName)){
          $PicMessage = "File Already Exists";
       }

       else{
           move_uploaded_file($PicTempName, "../photos/". $PicName);
           $PicMessage = "Stored in: ". "../photos/". $PicName;
       }
      }

}

else{
$PicMessage = "Invalid File Type";
}
</code></pre>

<p>The Picture message displays that the file was transferred but the ptohos folder is empty. I really can't think about what is wrong.</p>

<p>Many thanks in advance to all who will spend their time for helping me.</p>
