It’s the usual story, bored in a travel lodge finishing some blog drafts / projects I’ve got saved.
PHP-Cat is an example of how one can use the browser php script that I published; PHP-Cat is a web based tool that allows you to browse the file system of the webserever / host , you can then select a text file and view it through your broswer. What’s clever is that you are not just limited to files in a webservers root directory, you can view any* directory ! (Needless to say, this script cannot by-pass filesystem security, see comment below.)
PHP-Cat comes with two configurable options:
- $STARTDIRECTORY: This basically sets the applications $HOME directory, i.e. the first directory loaded by index.php, from there users can drill down the file structure and view text files. The default $STARTDIRECTORY: is the install dir.
- $USERBROWSING: If you want to give your users the freedom to view anything* then this gives the page a form wich allows you to type in a path to “jump to”, and again you could drill down from there. By Default this is disbaled.
The code is aplha code because it’s not exactly a slick project, there are two main issues (1) there is no file checking, so theres nothing to stop you trying to view binary files & (2) the interface isn’t exactly skinned, so you wouldn’t want to publish it in formatted system/page without getting you web coder to make it pretty
You can download a copy here http://www.linickx.com/files/php/php-cat-ALPHA.tar.gz
Install is straight forward, unpack into you webroot and point your broswer at it, the configurable options are clearly labled in index.php. I’ve only tested this on a linux machine, but I’ve used pure php syntax so there’s no reason why you couldn’t use it on a window$ machine.
If you have any questions you can Contact Me
*Anything ? Well kinda, this is a very simple php script, what can be displayed depends on the file system perssions for the webserever user. With a fedora core example, the webserver user is apache so the directorys that can be listed, and the files that can view viewed by apache & the application, need to be either owned by apache or world readable.