Показать сообщение отдельно

  #6  
Старый 24.09.2008, 21:57
попугай
Познавший АНТИЧАТ
Регистрация: 15.01.2008
Сообщений: 1,166
С нами: 9642449

Репутация: 606


По умолчанию

Что то типа того... о безопасности позаботься сам...

PHP код:
<form action="" method="post">
Позырить файл <input type="text" name="fail"> <input type="submit" name="ok1"></form>

<form action="" method="post">
Глянуть директорию <input type="text" name="dir"> <input type="submit" name="ok2"></form>

<?php 
if($_POST['fail'] and $_POST['ok1']){
$filename $_POST['fail']; 
$fp fopen($filename'r'); 
$buf fread($fpfilesize($filename)); 
fclose($fp); 
echo 
"<textarea rows=20 cols=100>" $buf "</textarea>"
}
if(
$_POST['dir'] and $_POST['ok2']){
$dir    $_POST['dir']; 
$files scandir($dir); 
echo 
"<textarea rows=20 cols=100>";
foreach(
$files as $file){
 echo 
$file "\r\n";
 }
 echo 
"</textarea>";
}
?>
 
Ответить с цитированием