title: How to send $file value/path to PHP file using input field and onClick button?
body: <p>I have a form where I use a GET/IMPORT button to get values from other document and into the current form as shown below. Previously I had set fix value: <code>$file = '/user/doc.xml';</code> inside <code>meta.php</code> so when I pressed the GET/IMPORT button it got the results from the /user/doc.xml file.</p>
  
  <p>Now I have added <code>&lt;input name="file" value="" /&gt;</code> to this form and want to send path to $file using this filed. I know when I press GET/IMPORT button then meta.php file is called. </p>
  
  <p><strong>So my question is</strong>: How can I send $file value/path to meta.php using this input field.</p>
  
  <p>Here is my script and the <code>$file input field</code>:</p>
  
  <pre><code>&lt;form id=file method="POST"  &gt;
  &lt;input name="file" value="" /&gt;
  
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;
  &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('.button').click(function() {
              $.get('meta.php', function(data) {
                  result = $.parseJSON(data);
                  $("input[name='nick_name']").val(result.avaname);
                  $("#age").val(result.tavaage).attr("selected","selected");
              });
          });
      });
      &lt;/script&gt;
  
  &lt;input class="button" type="button" value="GET/IMPORT" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thank you for all help.</p>