title: jquery ajax variable to php
body: <p>I'm stuck since 2 weeks, since i decided to use a nice threeview based on the jquery library.
  My problem is what i'm trying to get the value of an selected folder as an variable to php.</p>
  
  <p>I'm able to get the value and show it via an Alertbox in Jquery but the value is not posted to the PHP variable. echo shows nothing.</p>
  
  <h2>Text under is just to clarify why i need to use this solution with php and so on.</h2>
  
  <p>Then this is solved i will keep on struggling to get the whole path that i later will send to a bash script what is already finished. It creates a text file with metatags from an flac or mp3 album for my SQL db already done and working. This app is local for maintainance of the database.</p>
  
  <p>To my problem and code (bear in min what jquery and ajax is totally new for my)</p>
  
  <p>filename: file_browser.php
  Jquery part</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function()
  {
      $("button").click(function()
      {
          var dir = ($(".active").text())
          $.ajax({
              type: "POST",
              url:"file_browser.php",
              data: dir,
              success: function(data){ 
              alert(dir); dir }
          });
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>PHP code</p>
  
  <pre><code>&lt;?php
      echo "&lt;form&gt;
            &lt;button&gt;Append&lt;/button&gt;
            &lt;div id'japp'&gt;";
      if (isset($_POST['dir'])) {
          $dir = $_POST['dir']; }
          echo $dir;
         echo "&lt;/div&gt; 
                &lt;/form&gt;"; 
  ?&gt;
  </code></pre>
  
  <p>I will keep on trying, now i at leasthave an chance to get some help to avoid taking one more week on this :).</p>