title: Passing variable to popup box
body: <p>i have a bit complicated problem about passing variables in php.  </p>
  
  <p>I have listed and nested items in html <code>&lt;ul&gt;</code> tag and near every item i have button which should edit name of directory or file(<code>&lt;ul&gt;</code> list are generated from existing directory tree view in server).  </p>
  
  <p>I managed to make a popup form to let user enter new name and i have path to the old name.  </p>
  
  <p><strong>list part in index.html(which is generated):</strong></p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;folder&lt;/p&gt;
    &lt;div class="edit-button"&gt;
      &lt;a href="index.php?path=!working part with getting path!&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;ul&gt;
      &lt;li&gt;
      ... and here subfolders etc
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p><strong>popup form part in index.html:</strong>  </p>
  
  <pre><code>&lt;div id="popupEdit" class="popupEdit"&gt;
      &lt;?php $path = $_GET['path']; ?&gt;
      &lt;div class="popupEdit-content"&gt;
          &lt;form action="rename.php" method="post"&gt;
              &lt;input type="text" name="path" value="&lt;?php echo $path; ?&gt;" &gt;
              &lt;input type="text" name="new-name" placeholder="nowa nazwa"&gt;
              &lt;input type="submit" value="Submit" class="popupEdit-submit"&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>first input with name <code>path</code> will be hidden to pass through path of the file.
  <code>rename.php</code> works fine with static new name so it's just about passing <code>new-name</code> into that file.  </p>
  
  <p>So there are two major problems here:</p>
  
  <ol>
  <li>when i open popup window after clicking in editing button i have refreshed page(because of <code>a</code> tag) so my popup dont last long because in default(after refresh) popup have <code>display: none</code> </li>
  <li>after button is clicked for the first time i dont get <code>path</code> property into <code>input</code> but when url of site is already filled with <code>?path=...</code> part it's good and on popup for half of second(before it's reloaded) i am able to see that input with name <code>path</code> is filled with path correctly.  </li>
  </ol>
  
  <p>I think it's possible with ajax request but i have no idea how to making that possible.  </p>
  
  <p>I just want to edit current node name, maybe there is simplier way to do this?</p>