Hello -

I'm working on an application to move files to different directories on the server, and am using an application that I've run into a little trouble with - can anyone tell me how to set the destination of the code snippet?

} else if ($allowmove && ($act == "move")) {
for ($i = 0; $i < count($selfiles); $i++) {
$file = $selfiles[$i];

     if (isset($file) && ($file != "") && isset($dest)) {
        if (!checkFileName($file) || (($subdir == "") && ($file == $trashcan))) {
           redirectWithMsg("warning", "mov1");
        } else if (($dest != "..") && !checkFileName($dest)) {
           redirectWithMsg("warning", "mov2");
        } else {
           $fp = getFilePath($file);
           $fpd = ($dest == "") ? $basedir : getFilePath($dest);
           $fp_alias = $fp.".".$filealiasext;
           $fpd_alias = $fpd."/".@basename($file).".".$filealiasext;

           $destinfo = ($dest == "") ? "main directory" : (($dest == "..") ? "upper directory" : $dest);

           if (@is_dir($fpd)) {
              if (@rename($fp, $fpd."/".@basename($file))) {
                 if ($filealiases && @is_readable($fp_alias)) @rename($fp_alias, $fpd_alias);
              } else {
                 redirectWithMsg("error", "mov4", $file, $destinfo);
              }
           } else {
              redirectWithMsg("error", "mov5", $dest);
           }
        }
     } else {
        redirectWithMsg("warning", "mov6");
     }
  }
  redirectWithMsg("info", "mov3", $destinfo);

Thanks in advance,

J.D.

    Don't you just set $dest?

      oh, how could you do that?

      thanks, sorry.

      J.d.

        Write a Reply...