Script: iBrowser v1.0
Author: Gex
Description: iBrowser is a script which browser the server it lies on for files and folders and show them to you with the capability of interactive browsing with your mouse click, it may be simple but i find it useful :) i hope it helps.
Notes: u will need the images links, you can find em' here and you need to place them in the script directory: Download Icons Here
Demo: iBrowser v1.0
<style type="text/css">
<!--
body {
font-family:Corbel,Verdana;
font-size:15px;
margin-left:12px;
margin-bottom:30px;
background-color:#252525;
color:#66FF00;
}
.x {
text-decoration:none;
color:#66FF00;
}
filesize {
margin-left:400px;
margin-bottom:30px;
background-color:#252525;
color:#66FF00;
font-family:Corbel,Verdana;
font-size:15px;
}
</style>
<?php
echo "<title>iBrowser™</title><div align="center">
<form name="form1" action="iBrowser.php" method="get">
<input size=100 style="background-color:#F9F9F9;color:#252525;border:thin;" type="text" name="directory" value=".getcwd()."><input type="submit" name="submit" value="Go!">
</form></div><hr>";
function listfiles($d) {
if ($d != null) {
chdir($d);
$contents = scandir($d);
} else { $contents = scandir(getcwd()); }
$num = count($contents);
$x = 0;
while ($num > $x) {
if ($contents[$x] != "." && $contents[$x] != "..") {
if(is_file($d."/".$contents[$x]) || is_file($contents[$x])) {
$files[count($files)] = $contents[$x];
}
else {
$dir[count($dir)] = $contents[$x];
}
}
$x++;
}
$arr = explode("/",getcwd());
$updir = str_replace($arr[(count($arr))-1],"",getcwd());
echo "<img src="back.gif"> <a class=x href="".$_SERVER['PHP_SELF']."?directory=".$updir."">Up One Directory</a><br><br><font color=#CCCCCC>File/Folder:</font><hr>";
$x=0;
$num=count($dir);
while ($x < $num ) {
echo "<img src="folder.gif"> <a class=x href="".$_SERVER['PHP_SELF']."?directory=".getcwd()."/".$dir[$x]."">".$dir[$x]."</a><br>";
$x++;
}
$x = 0;
$num=count($files);
$pathparts = pathinfo($_SERVER['SCRIPT_FILENAME']);
while ($x < $num ) {
echo "<img src="file.gif"> <a class=x href="".str_replace($pathparts['dirname'],"",getcwd())."/".$files[$x]."">".$files[$x]."</a><br>";
$x++;
}
$cdir = getcwd();
//$cdir = str_replace("","",$cdir);
echo "<script language="javascript">
document.form1.directory.value = "".$cdir."";
</script><hr><br><div align="center">All copyrights reserved ©2007-2008<br>Developed By <font color=#CCCCCC>Gex</font></div>";
}
listfiles($_GET['directory']);
?>