title: php forms multiple input upload
body: <p>I wrote a multiple form, but it doesn't work. Code inspector tells me something is wrong with move_uploaded_file function. Can anyone tell me what the problem is?</p>
  
  <p>My HTML code:</p>
  
  <pre><code>&lt;div class="setting post"&gt;
      &lt;form action="add-banner.php" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="text" name="banner-title" placeholder="enter new banner title"&gt;&lt;br&gt;
      &lt;select name="banner-cat"&gt;
             &lt;?php
             $get_cats = mysqli_query($db,'select * from cats');
             while($row = mysqli_fetch_assoc($get_cats)){
             ?&gt;
             &lt;option value="&lt;?php echo $row['id']?&gt;"&gt;&lt;?php echo $row['cat_name'] ?&gt;&lt;/option&gt;
             &lt;?php
             }
             ?&gt;
             &lt;/select&gt;
             &lt;br&gt;
             &lt;input type="file" name="banner"&gt;
             &lt;br&gt;
       &lt;input type="submit" name="upload" value="add new banner"&gt;
       &lt;/form&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>and this is my php code:</p>
  
  <pre><code>&lt;?php
  require_once 'db.php';
  global $db;
  $banner_title = $_POST['banner-title'];
  $banner_cat = $_POST['banner-cat'];
  $banner = $_FILES['banner']['name'];
  $banner_tmp = $_FILES['banner']['tmp_name'];
  $upload_file = move_uploaded_file($banner_tmp,'../../images/$banner');
  $insert_banner = mysqli_query($db,"insert into banner(banner_title,banner_cat,banner_link) values ('$banner_title','$banner_cat','$banner')");
  if($insert_banner &amp;&amp; $upload_file){
      $message = 'New banner Succesfully added';
      echo "&lt;script&gt;
      alert('".$message."');
      window.location.href='post.php';
      exit;
      &lt;/script&gt;";
  
      }else{$message = 'Something goes Wrong';
      echo "&lt;script&gt;
      alert('".$message."');
      window.location.href='post.php';
      exit;
      &lt;/script&gt;"; 
      }
  ?&gt;
  </code></pre>