title: upload image to root directory from sub directory php
body: <p>Hi I have this php which i need to change, I have made a duplicate of my site and stored it in a subdirectory called m/ I want to be able to upload files from the m/ directory site into the root directory site. this is the function for the script:</p>
  
  <pre><code>global $MAX_FILE_SIZE;
  
      global $MAX_THUMB_HEIGHT;
  
      global $MAX_THUMB_WIDTH;
  
      global $DELETE_ORIGIN_IMAGE;
  
      global $myfile;
  
  
      $err = check_err();
      if(!empty($err))
          return edit_profile_form($err);
  
  
  
      /*** Upload logo image*/
  
      if($_FILES['business_logo'])
  
      {
          //die($MAX_FILE_SIZE.'x');
          $business_logo=uploadfile("../img/consumer_user/",$_FILES['business_logo'],0,$MAX_FILE_SIZE);
      }
  
      if($business_logo=='-1')
  
      {
  
          $err['upload_logo'] = "&lt;span style=\"color: red;\"&gt;- Upload error with &lt;b&gt;Business Logo&lt;/b&gt;. Cannot be uploaded due to permission.&lt;/span&gt;&lt;br&gt;";
  
      }
  
      else if($business_logo=='0')
  
      {
  
          $err['upload_logo'] = "&lt;span style=\"color: red;\"&gt;- Upload error with &lt;b&gt;Business Logo&lt;/b&gt;. File type not allowed&lt;/span&gt;&lt;br&gt;";
  
      }
  
      else if($business_logo=='1')
  
      {
  
          $err['upload_logo'] = "&lt;span style=\"color: red;\"&gt;- Upload error with &lt;b&gt;Business Logo&lt;/b&gt;. File size not allowed&lt;/span&gt;&lt;br&gt;";
  
      }
  
      else if($business_logo=='2')
  
      {
  
          $business_logo="";
  
      }
  
      //echo $business_logo;
  
      if ($business_logo)
  
      {
  
          if($_FILES['business_logo']['name'])
  
          {
  
              $myfile=str_replace(" ","_",$_FILES['business_logo']['name']);
  
              $myfile=time()."_".$myfile;//echo $myfile;
  
              if ($myfile)
  
              {
  
                  //Create thumbnail
  
                  for($i=0;$i&lt;count($MAX_THUMB_WIDTH);$i++)
  
                  {
  
                      $MAX_QUALITY[$i]=$MAX_THUMB_WIDTH[$i]&gt;$MAX_THUMB_HEIGHT[$i]?$MAX_THUMB_WIDTH[$i]:$MAX_THUMB_HEIGHT[$i];
  
                      thumbnail_images($_FILES['business_logo'],$MAX_THUMB_WIDTH[$i] ,$MAX_THUMB_HEIGHT[$i] ,"../img/consumer_user/","thumb_".$i,$myfile); 
  
                  }
  
                  if($DELETE_ORIGIN_IMAGE)
  
                  {
  
                      deletefile("../img/consumer_user/".$myfile);
  
                  }
  
              }
  
          }
  
      }
      if(!empty($err))
          return edit_profile_form($err);
  </code></pre>
  
  <p>as you can see I am trying to get out of the m/ by putting the obvious ../ but it doesnt seem to work.</p>
  
  <p>Any advice? Thanks</p>