title: Upload file to server using PHP and HTML
body: <p>I have a problem loading the file to the server in PHP and HTML using move_uploaded_file () when I put PHP files in this way <a href="http://mydomin.com/uploadfile.php" rel="nofollow noreferrer">http://mydomin.com/uploadfile.php</a> succeed the process and if this way <a href="http://mydomin.com/uploadfiles/uploadfile.php" rel="nofollow noreferrer">http://mydomin.com/uploadfiles/uploadfile.php</a> The the process fails</p>
  
  <p>code php </p>
  
  <pre><code>&lt;?php
  if (isset($_FILES['image'])) {
  
      $idApp = uniqid();
      $uploadDir = '../images/';
      $uploadedFile = $uploadDir . $idApp . ".jpg";
  
      if(move_uploaded_file($_FILES['image']['tmp_name'], $uploadedFile)) {
  
      echo"Success: ".$_FILES['image']['tmp_name']. $uploadedFile;
      } else {
  
      echo"error 2";
      }
  
  } else {
  
      echo"error 3";
  }
  ?&gt;
  </code></pre>
  
  <p>code html</p>
  
  <pre><code>&lt;form action="add.php" method="POST" enctype="multipart/form-data"&gt;
  
      &lt;input type='file' name='image' id='image'&gt;
      &lt;div align='center''&gt;&lt;input type='submit' id='myButton' value='add'&gt;&lt;/div&gt;";
  
  &lt;/form&gt;
  </code></pre>