Просмотр файла sman/set/rename_path.php

Размер файла: 798B
<?php

include_once '../../sman/includs/configurations.php';

$file_opt = 'true';

include_once '../../sman/includs/head.php';

if (isset($_GET['path'])) {



$path_name = end(explode('/', $_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 = "'.$path_name.'">

<br />

<input type = "submit" value = "Переименовать">

<br />';

include_once '../../sman/includs/foot.php';

} else {

header("Location: /sman/index.php");

exit;

}
?>