如何创建树目录结构?

时间:2018-08-04 10:37:56

标签: php jquery html web-applications directory

您好,我需要为WebApp创建一个PHP的树目录结构 ...

对于树目录结构,我的意思是一个名为 $ idCantiere 的主文件夹(我从文本框中获取此ID),并且需要在该主文件夹中创建另一个名为 $ codiceCommessa 的目录。 strong>(也可以从txtBox中获取)...

我正在使用Altervista

我已经尝试过使用此脚本,但是它不起作用

 <form method="POST" action="directory.php">
<table>
<tr>
           <td bgcolor="#B2E5FB">Cantiere</td>
           <td colspan="11">&nbsp;<input type="text" name="idCantiere" id="idCantiere"></td>
         </tr>


<tr>
           <td bgcolor="#B2E5FB">Codice Commessa</td>
           <td colspan="11">&nbsp;<input type="text" name="codiceCommessa" id="codiceCommessa"></td>
         </tr>
         <tr>
         <td><button name="insAffidatario" type="submit">Inserisci Affidatario</button>
         </td>
         </tr>
 </table>
 
</form>

文件directory.php

`

  <?php
  $idCantiere = $_POST["idCantiere"];
  $codiceCommessa = $_POST["codiceCommessa"];
  echo("Registrazione avvenuta     ".$codiceCommessa);
  date_default_timezone_set('Europe/Rome');
  $date = date('Y-m-d');
  chdir("../prova");
  opendir(".");


  if(mkdir("../prova/utenti/".$date."_".$idCantiere)) 
  {
  echo "Directory Created";
  }

  if(mkdir("../prova/utenti/".$date."_".$idCantiere/$codiceCommessa))
  {
   echo "Directory Created";
  }
?>

`

0 个答案:

没有答案
相关问题