PHP returns Invalid Request Error
<p>I am saving data from Android device to MySQL. My code works fine using Localhost, but when I try it using my hosted domain. It gives me and error.</p>

<p><strong>Error returned</strong></p>

<pre><code>ERROR
The requested URL could not be retrieved

While trying to process the request:

POST /insert.php HTTP/1.1
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
Host: mydomain.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)

The following error was encountered:
Invalid Request
</code></pre>

<p><strong>Java code inside AsyncTask</strong></p>

<pre><code>.
.
.
ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
nameValuePairs.add(new BasicNameValuePair("user_id", userId));
HttpPost httppost = new HttpPost("http://mydomain.com/insert.php");
HttpClient httpclient = new DefaultHttpClient();

UrlEncodedFormEntity urlEncodeFormEntity = new UrlEncodedFormEntity(nameValuePairs);
urlEncodeFormEntity.setChunked(true);

httppost.setEntity(urlEncodeFormEntity);
HttpResponse response = httpclient.execute(httppost);
.
.
.
</code></pre>

<p>Please help me solved this problem. Again it working using Localhost.</p>

<p><strong>EDIT:</strong> </p>

<p><strong>PHP Code: this is just to test if my device can reach the given URL</strong></p>

<pre><code>&lt;?php
    echo "Ive been reached.";
    //Codes to connect DB and To Insert goes here
?&gt;
</code></pre>
