File size: 808B
<?php
include_once '../../sman/includs/configurations.php';
$file_opt = 'true';
include_once '../../sman/includs/head.php';
if (isset($_GET['path'])) {
$path_name = basename($_GET['path']);
$path = substr($_GET['path'], 0, -mb_strlen($path_name)-1);
if (isset($_GET['rename'])) {
rename(ROOT.'/'.$_GET['path'], ROOT.'/'.$path.'/'.$_POST['path_name']);
header("Location: /sman/set/rename.php?path=/".$path."/".$_POST['path_name']);
exit;
}
echo '<form action = "?path='.$_GET['path'].'&rename" method = "POST">
Имя файла: <br />
<input name = "path_name" value = "'.htmlspecialchars($path_name).'">
<br />
<input type = "submit" value = "Переименовать">
<br />';
include_once '../../sman/includs/foot.php';
} else {
header("Location: /sman/index.php");
exit;
}
?>