title: image cannot upload to folder
body: <p>i have a small problem i cannot figure out i need to upload an image to a folder called upload i successfully uploaded the name of the image to database table but for some reason the image is not being uploaded to folder here is my code </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?PHP
  
  session_start();
  $_SESSION['url'] = $_SERVER['REQUEST_URI'];
  
  if (!(isset($_SESSION['email']) &amp;&amp; $_SESSION['email'] != '')) {
    header ("Location: log-in/login");
  }
  
  ?&gt;
  &lt;?php
  include('configur.php');     
  
  if(isset($_SESSION['email'])){
      echo "Welcome '{$_SESSION['email']}'";
  }      
  ?&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;?php
  echo"&lt;a href = log-in/logout&gt; Log out &lt;/a&gt;";  
  ?&gt;&lt;br&gt; &lt;br&gt;
  &lt;?php
   require_once("configur.php");    
  
  $query='UPDATE profile_table SET   images="'.$_FILES['file']['name'].'"
  WHERE email= "'.$_SESSION['email'].'"';
  
  if ($mysqli-&gt;query($query) === TRUE) {
      echo "Record updated successfully";
  } else {
      echo "Error updating record: " . $conn-&gt;error;
  }
  
  $mysqli-&gt;close();
  ?&gt;
  
  &lt;?php
  
  include('configur.php');
   if($_POST)
   { 
   // $_FILES["file"]["error"] is HTTP File Upload variables $_FILES["file"] "file" is the name of input field you have in form tag.     
  
   if ($_FILES["file"]["error"] &gt; 0)
   {
   // if there is error in file uploading 
   echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br /&gt;";    
  
   }
   else
   {
   // check if file already exit in "images" folder.
   if (file_exists("upload" . $_FILES["file"]["name"]))
   {     
   }
   else
   {  //move_uploaded_file function will upload your image. 
   if(move_uploaded_file($_FILES["file"]["tmp_name"],"upload" . $_FILES["file"]["name"]))
   {
   // If file has uploaded successfully, store its name in data base
   $query_image = "insert into profile_table";
    
   if(mysqli_query($link, $query_image))
   {
   echo "Stored in: " . "upload" . $_FILES["file"]["name"];
   }
   else
   {
   echo'';
   }
   }
   }
   }
   }
  
   ?&gt;</code></pre>
  </div>
  </div>
  </p>