Can TinyFileManager.php be modified to accept URL string as root_path variable?

  php

I would like to modify TinyFileManager.php from https://tinyfilemanager.github.io/ to accept a URL parameter to replace the hard coded "$root_path = ”; and the "$root_path = ”;.

I have tried replacing it with
$root_path = $_GET['myRoot'];
and using domain.com/tinyfilemanager.php?myRoot=/rfq_documents/2071 as the url.

I also modified the ‘//always use ?p lines to be:

// always use ?p=
if (!isset($_GET['p']) && empty($_FILES)) {
fm_redirect(FM_SELF_URL . '?p=&myRoot='.$_GET['myRoot']);
}

It works on the initial display but looses the $root_path on selecting folder or a files. It reports "Root path "" not found!"
I know nothing about PHP and every time I make a small change I break it.

This script works great if I hard code the $root_path = '/rfq_documents/';
But that folder has over 6,000 sub folders in it and I want the user to be able to go directly to one of the many sub-folders by clicking a hyperlink.

rfq_documents is a permanent folder. Each sub_folder under that one is created and tired to a MySQL table record ID number to hold various documents associated with Request for Quote (RFQ). While updating RFQ #2071 data I would like to provide a hyperlink to those files in rfq_documents71.

Microsoft’s last update broke my <iframe name="I5" src="file://server/rfq_documents$/#rfq.id#" style="width: 100%; height: 200px;"></iframe> but it never worked in Chrome without the IE Tabs plug-in anyway. This is on our intranet, no external access.
Can anyone help please?

Source: Ask PHP

LEAVE A COMMENT