title: Moving an uploaded file using PHP
body: <p>please could someone check this for me?  I have followed the info that I found on here and still I cant get it to work.  My host says that this should now be possible as the permissions were previously blocked, and are not exactly the most helpful.
  Thanks, I can always rely on StackOverflow to help out when needed.  :)</p>
  
  <pre><code>&lt;?PHP
  IF(isset($_POST['submit'])){
      $caption = $_POST['caption'];
      $file = $_FILES['file']['name'];
      $target="images/slider";
      if(is_uploaded_file($_FILES['file']['tmp_name'])){
  
      move_uploaded_file($_FILES['file']['tmp_name'], 'images/slider/'.$_FILES['file']['name']) or die ('cannot upload');
  
      require_once('../includes/dbupcombo.php');
  
          $query = "INSERT INTO PremierSlider (caption, image) values ('$caption','$file')";
          mysql_query($query) or die(mysql_error());
  
  
  }
  header("location: http://www.premierdancecentre.com/admin/index.php#mod_image");
  }
  ?&gt;
  </code></pre>
  
  <p>The script runs onclick and returns 'cannot upload'.  Any help as to why would be greatly appreciated as i'm still trying to get good at PHP.  Cheers guys</p>