Просмотр файла www/adm/js/create_dir.php

Размер файла: 1.02Kb
<?php
session_start();
$cms = $_SESSION['cms_2'];
 if ($_POST['create_file'] != '' && strlen($_POST['create_file']) > 3)
{
 if ($_POST['create_file'] == 'www' || $_POST['create_file'] == 'public_html' || $_POST['create_file'] == '0')
 {
  $_POST['create_file'] = 'directory';
 }
 if (is_dir($cms.$_POST['create_file']))
 {
  $_POST['create_file'] = $_POST['create_file'].'(2)';
 }
 if (@mkdir($cms.$_POST['create_file'],0777))
 {
 echo '
 <script type="text/javascript">
 function rel(){
 parent.location.reload();
 }

 function endPart(){
 	parent.document.create_form.create_file.value = "Перезагружаю...";
 }
 parent.document.create_form.create_file.value = "Готово";
 setTimeout("endPart()", 1000);
 setTimeout("rel()", 2000);
 </script>
 ';
 }
 else
 {
 echo '
 <script type="text/javascript">
 function endPart(){
 	parent.document.create_form.create_file.value = "Не создана...";
 }
 parent.document.create_form.create_file.value = "Ошибка";
 setTimeout("endPart()", 1000);
 </script>
 ';
 }
}
?>