title: Posting variable from java application to PHP
body: <p>I am building a java application using Netbeans, I want to create a JButton to post a value from my application to a php file. 
  I am applying the following code and it is not working:</p>
  
  <pre><code>private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                         
  
   try{
  HttpClient httpclient = HttpClients.createDefault();
  HttpPost httppost = new HttpPost("http://localhost/blow.php/");
  
  List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(2);
  params.add(new BasicNameValuePair("date", "12/11/2016"));
  
  httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
  
  //Execute and get the response.
  HttpResponse response = httpclient.execute(httppost);
  HttpEntity entity = response.getEntity();
  
  if (entity != null) {
      InputStream instream = entity.getContent();
      try {
          // do something useful
      } finally {
          instream.close();
      }
  }
          }catch(Exception w){
              System.err.println(w);}
  // open file location and check 
  String FolderName="http:\\localhost/blow.php";//Write your complete path here
  try {
  Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + FolderName);
      } catch (IOException ex) {
            Logger.getLogger(blowing.class.getName()).log(Level.SEVERE, null, ex);
      }      
  
  
      }
  </code></pre>
  
  <p>and in the php file only this is written:</p>
  
  <pre><code> &lt;?php
  
     $da=$_POST['date'];
     echo $da;
  
   ?&gt;
  </code></pre>
  
  <p>Can you help with this please, thanks</p>