title: Android call PHP with HTTP-GET
body: <p>My question is: How to call a php with HttpPost?</p>
  
  <pre><code> final HttpClient httpclient = new DefaultHttpClient();
  final HttpPost httppost = new HttpPost("www.example.de/mySkript.php");
  final ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
  nameValuePairs.add(new BasicNameValuePair("param1", "value1"));
  nameValuePairs.add(new BasicNameValuePair("param2", "value2"));
  
  httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  final HttpResponse response = httpclient.execute(httppost);
  </code></pre>
  
  <p>We found this...but we don't want to send Parameters/Values to the PHP because our PHP is counting +1 if you call it through the URL. Any code for just call the PHP?</p>
  
  <p>Thank you :)</p>
  
  <p>edit:
  The PHP is:</p>
  
  <pre><code>&lt;?php
  $userdatei = fopen ("test.txt","r");
  $zeile = fgets($userdatei, 500);
  $zeile++;
  fclose($userdatei);
  
  $schreiben = fopen ("test.txt","w");
  fwrite($schreiben, $zeile);
  fclose($schreiben);
  ?&gt;
  </code></pre>
  
  <p>And Use this Code:</p>
  
  <pre><code>    public static HttpResponse hitUrl(String url) {
        try {
          HttpClient httpclient = new DefaultHttpClient();
          HttpResponse response = httpclient.execute(new HttpGet(url));
          return response;
        } catch (Exception e) {
            e.printStackTrace();
          return null;
        }
      }
  </code></pre>
  
  <p>And call it with:</p>
  
  <pre><code>hitUrl("http://example.de/test.php");
  </code></pre>
  
  <p>Is this right?</p>