index.php
----------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Untitled Document</title>
</head>
<body>
<?php
if(!isset($_POST['go']))
{
echo '<form action="" method="POST" enctype="multipart/form-data">
<select size="4" name="read">
<option value="0">Оборудование</option>
<option value="1">Отчет</option>
<option value="2">Главная</option>
</select><br>
<input type="submit" value="Выбрать" name="go">
</form>';
}else {
$who=$_POST['read'];
$vibor = array(
0 => 'odorodovanie.html',
1 => 'history.html',
2 => 'main.html',
);
$file = $vibor[$who];
$save = file_get_contents($file);
echo '
<form method="POST" action="save.php" enctype="multipart/form-data">
<textarea rows="10" cols="100" name="save">'.$save.'
</textarea><br>
<input type="hidden" value="'.$q.'" name="q">
<input type="submit" value="Coxранить">
</form>';
}
unset($_POST['read']);
?>
</body>
</html>
-------------------------------------------------------------------------
save.php
-------------------------------------------------------------------------
<?php
$q = $_POST['q'];
$fd = fopen($q , 'wa');
if(fwrite($fd, $_POST['save'])) echo 'Отредактировал';
fclose($fd);
?>