title: How to find out the relative path to upload image in php?
body: <p>I have a problem to find out the relative path to 
  upload the images to other directories</p>
  
  <p><strong>target directory</strong></p>
  
  <pre><code>htdocs/dt3/tadi/adm/dim/dim_images/tadi_user_images/
  </code></pre>
  
  <p><strong>source directory</strong>    </p>
  
  <pre><code>htdocs/dt3/tadi/adm/cbt/uploadfile.php
  </code></pre>
  
  <h2>uploadfile.php</h2>
  
  <pre><code>&lt;html&gt;
      &lt;form method="post"enctype="multipart/form-data"&gt;
          &lt;input type="file" name="fileimg1" &gt;&lt;input type="submit" name="upload"&gt;
      &lt;/form&gt;
  &lt;/html&gt;
  
  
  &lt;?php
      $dirname = "/dt3/tadi/adm/dim/dim_images/tadi_user_images/";    
  
      $of = $_FILES['fileimg1']['name'];
      $ext = pathinfo($of, PATHINFO_EXTENSION);
  
      $changename3 = time() * 24 * 60;
      $image_name3 = "timage_" . $changename3 . "." . $ext;
  
      $final_pathdir = $dirname . $image_name3;
      $suc = move_uploaded_file($_FILES['fileimg1']['tmp_name'], $final_pathdir);
  
      if ($suc &gt; 0) 
      {
          echo "Image uploaded successfully"; 
      } 
      else 
      {
          echo "Error : " . $_FILES['filimg1']['error'];
      }
  ?&gt;  
  </code></pre>
  
  <p>I tried out some of the paths, I didnt got any solution for that.<br>
  How can I upload images to that path? </p>
  
  <p><code>htdocs/dt3/tadi/adm/dim/dim_images/tadi_user_images/</code></p>
  
  <p>With relative path only.</p>