title: Required parameter 'tag' is missing PHP
body: <p>i get this error Required parameter 'tag' is missing on android toast  please help ,me i can't find my fault below i have android user code and the php server code above i use volley library for httprequests </p>
  
  <pre><code>StringRequest strReq = new StringRequest(Request.Method.POST,
          AppConfig.URL_REGISTER, new Response.Listener&lt;String&gt;() {
  
      @Override
      public void onResponse(String response) {
          Log.d(TAG, "Register Response: " + response.toString());
          hideDialog();
          try {
              JSONObject jObj = new JSONObject(response);
              boolean error = jObj.getBoolean("error");
              if (!error) {
                  // User successfully stored in MySQL
                  // Now store the user in sqlite
                  String uid = jObj.getString("uid");
  
                  JSONObject user = jObj.getJSONObject("user");
                  String name = user.getString("name");
                  String email = user.getString("email");
                  String created_at = user
                          .getString("created_at");
  
                  // Inserting row in users table
                  db.addUser(name, email, uid, created_at);
  
                  // Launch login activity
                  Intent intent = new Intent(
                          RegisterActivity.this,
                          LoginActivity.class);
                  startActivity(intent);
                  finish();
              } else {
  
                  // Error occurred in registration. Get the error
                  // message
                  String errorMsg = jObj.getString("error_msg");
                  Toast.makeText(getApplicationContext(),
                          errorMsg, Toast.LENGTH_LONG).show();
              }
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
      }
  }, new Response.ErrorListener() {
  
      @Override
      public void onErrorResponse(VolleyError error) {
          Log.e(TAG, "Registration Error: " + error.getMessage());
          Toast.makeText(getApplicationContext(),
                  error.getMessage(), Toast.LENGTH_LONG).show();
          hideDialog();
      }
  })
  {
  
      @Override
      protected Map&lt;String, String&gt; getParams() {
          // Posting params to register url
          Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
          params.put("tag", "register");
          params.put("name", name);
          params.put("email", email);
          params.put("password", password);
  
          return params;
      }
  
      @Override
      public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
          HashMap&lt;String, String&gt; headers = new HashMap&lt;String, String&gt;();
          headers.put("Content-Type", "application/json; charset=utf-8");
          return headers;
      }
  };
  
  // Adding request to request queue
  AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
  </code></pre>
  
  <p>}</p>
  
  <p><em>AppcontrollerClass here</em></p>
  
  <pre><code>public class AppController extends Application {
  
      public static final String TAG = AppController.class.getSimpleName();
  
      private RequestQueue mRequestQueue;
  
      private static AppController mInstance;
  
      @Override
      public void onCreate() {
          super.onCreate();
          mInstance = this;
      }
  
      public static synchronized AppController getInstance() {
          return mInstance;
      }
  
      public RequestQueue getRequestQueue() {
          if (mRequestQueue == null) {
              mRequestQueue = Volley.newRequestQueue(getApplicationContext());
          }
  
          return mRequestQueue;
      }
  
      public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; req, String tag) {
          req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
          getRequestQueue().add(req);
      }
  
      public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; req) {
          req.setTag(TAG);
          getRequestQueue().add(req);
      }
  
      public void cancelPendingRequests(Object tag) {
          if (mRequestQueue != null) {
              mRequestQueue.cancelAll(tag);
          }
      }
  }
  </code></pre>
  
  <p>this is android log</p>
  
  <pre><code>  08-07 14:35:36.552  19120-20088/com.example.panos.chatsmartapp D/Volley﹕ [7445] BasicNetwork.logSlowRequests: HTTP response for request=&lt;[ ] http://192.168.1.3/android_login_api/ 0x355f917 NORMAL 1&gt; [lifetime=3858], [size=65], [rc=200], [retryCount=0]
  08-07 14:35:36.662  19120-19120/com.example.panos.chatsmartapp D/RegisterActivity﹕ Register Response: {"error":true,"error_msg":"Required parameter 'tag' is missing!"}
  08-07 14:35:36.702  19120-19120/com.example.panos.chatsmartapp D/Toast﹕ checkMirrorLinkEnabled returns : false
  08-07 14:35:36.702  19120-19120/com.example.panos.chatsmartapp D/Toast﹕ showing allowed
  08-07 14:35:36.702  19120-19120/com.example.panos.chatsmartapp D/Volley﹕ [1] Request.finish: 4253 ms: [ ] http://192.168.1.3/android_login_api/ 0x355f917 NORMAL 1
  08-07 14:35:36.712  19120-19120/com.example.panos.chatsmartapp E/ViewRootImpl﹕ sendUserActionEvent() mView == null
  </code></pre>
  
  <p>this is php code</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['tag']) &amp;&amp; $_POST['tag'] != '') {
      // get tag
      $tag = $_POST['tag'];
  
      // include db handler
      require_once 'include/DB_Functions.php';
      $db = new DB_Functions();
  
      // response Array
      $response = array("tag" =&gt; $tag, "error" =&gt; FALSE);
  
      // check for tag type
      if ($tag == 'login') {
          // Request type is check Login
          $email = $_POST['email'];
          $password = $_POST['password'];
  
          // check for user
          $user = $db-&gt;getUserByEmailAndPassword($email, $password);
          if ($user != false) {
              // user found
              $response["error"] = FALSE;
              $response["uid"] = $user["unique_id"];
              $response["user"]["name"] = $user["name"];
              $response["user"]["email"] = $user["email"];
              $response["user"]["created_at"] = $user["created_at"];
              $response["user"]["updated_at"] = $user["updated_at"];
              echo json_encode($response);
          } else {
              // user not found
              // echo json with error = 1
              $response["error"] = TRUE;
              $response["error_msg"] = "Incorrect email or password!";
              echo json_encode($response);
          }
      } else if ($tag == 'register') {
          // Request type is Register new user
          $name = $_POST['name'];
          $email = $_POST['email'];
          $password = $_POST['password'];
  
          // check if user is already existed
          if ($db-&gt;isUserExisted($email)) {
              // user is already existed - error response
              $response["error"] = TRUE;
              $response["error_msg"] = "User already existed";
              echo json_encode($response);
          } else {
              // store user
              $user = $db-&gt;storeUser($name, $email, $password);
              if ($user) {
                  // user stored successfully
                  $response["error"] = FALSE;
                  $response["uid"] = $user["unique_id"];
                  $response["user"]["name"] = $user["name"];
                  $response["user"]["email"] = $user["email"];
                  $response["user"]["created_at"] = $user["created_at"];
                  $response["user"]["updated_at"] = $user["updated_at"];
                  echo json_encode($response);
              } else {
                  // user failed to store
                  $response["error"] = TRUE;
                  $response["error_msg"] = "Error occured in Registartion";
                  echo json_encode($response);
              }
          }
      } else {
          // user failed to store
          $response["error"] = TRUE;
          $response["error_msg"] = "Unknow 'tag' value. It should be either 'login' or 'register'";
          echo json_encode($response);
      }
  } 
  else {
      $response["error"] = TRUE;
      $response["error_msg"] = "Required parameter 'tag' is missing!";
      echo json_encode($response);
  }
  
  ?&gt;
  </code></pre>
  
  <p>Myabe i have problem with utf8 string using json_encode/json_decode I do not know... </p>