Android : E/Volley: [3347] BasicNetwork.performRequest: Unexpected response code 403 for http://172.18.0.200/test.php
<p>I want to connect <code>Android</code> application to remote server. But i am getting this error</p>

<blockquote>
  <p>E/Volley: [3347] BasicNetwork.performRequest: Unexpected response code 403 for <a href="http://172.18.0.200/test.php" rel="nofollow noreferrer">http://172.18.0.200/test.php</a></p>
</blockquote>

<p>Server is a local laptop <code>172.18.0.200</code> (<code>PHP</code> script is running with <code>WAMP</code>)and client is a computer system (Android Studio). </p>

<p><strong>Singleton class code</strong></p>

<pre><code>package com.check;

import android.content.Context;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;



public class MySingleton {
    private static MySingleton mInstance;
    private RequestQueue requestQueue;
    private static Context mCtx;

    private MySingleton(Context context){
        mCtx=context;
        requestQueue = getRequestQueue();
    }

    public RequestQueue getRequestQueue(){
        if(requestQueue==null){
            requestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());
        }
        return requestQueue;

    }

    public static synchronized MySingleton getmInstance(Context context){
        if(mInstance==null){
            mInstance = new MySingleton(context);
        }
        return mInstance;
    }

    public void addRequestQueue(Request request ){
        requestQueue.add(request);
    }

}
</code></pre>

<p><strong>Main Activity Class code</strong></p>

<pre><code>package com.check;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import android.widget.Toast;

import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class MainActivity extends AppCompatActivity {
    TextView name,email;
    String serverAdress = "http://172.18.0.200/test.php";


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

            StringRequest Srequest = new StringRequest(Request.Method.POST, serverAdress, new Response.Listener&lt;String&gt;() {
                @Override
                public void onResponse(String response) {
                    try {
                        JSONArray ja = new JSONArray(response);
                        JSONObject jo = ja.getJSONObject(0);
                        String code = jo.getString("code");
                        String message = jo.getString("message");

                        name = (TextView) findViewById(R.id.textView);
                        email = (TextView) findViewById(R.id.textView2);
                        name.setText(jo.getString("code"));
                        email.setText(jo.getString("message"));
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    Toast.makeText(MainActivity.this,"Error",Toast.LENGTH_LONG).show();
                    error.printStackTrace();
                }
            }
            ){
                @Override
                protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                    Map&lt;String,String&gt; parameters = new HashMap&lt;String, String&gt;();
                    return parameters;
                }
            };
            MySingleton.getmInstance(MainActivity.this).addRequestQueue(Srequest);
        }
    }
</code></pre>

<p><strong>PHP Code on server</strong> </p>

<pre><code>&lt;?php

    require 'vendor/autoload.php';
    $result = array();
    echo("&lt;br&gt;");

        $code = "Login Failed";
        $message = "User NOT fOUND...Try again";
        array_push($result,array("code"=&gt;$code,"message"=&gt; $message);
        echo json_encode($result);

    ?&gt;
</code></pre>

<p>I have read this <a href="https://stackoverflow.com/questions/28643765/basicnetwork-performrequest-unexpected-response-code-403-for-http-localhost-d">Stack Question</a> but not gives any solution.</p>