title: Issue while trying to create login User Screen in Xcode
body: <p>I tried to create a login screen (UserID + Password) for allow user to go to the Main screen.</p>
  
  <p>I use for my test a local phpmyadmin with a database named GLOBAL and one table called user that contain the column: user_ID / user_name / user_password</p>
  
  <p>This is my Xcode code:</p>
  
  <pre><code>Alamofire.request(urlString, method: .get, parameters: parameters).responseJSON
  {
                  response  in
  
                  if let error = response.result.error as? AFError {
                      if case .responseValidationFailed(.unacceptableStatusCode(let code)) = error {
                          print("ERROR:\(code)")
                      }
                  }
  
                  let status = response.response?.statusCode
                  print("STATUS \(status)")
                  print("ERROR \(response.result.error)")
                  print("RESULT \(response.result.value)")
                  if let result = response.result.value
  
                  {
                      let jsonData = result as! NSDictionary
                      let val = jsonData.value(forKey: "value") as! Int64
                      print("VALUE:\(val)")
  
                      if(val==0){
                          print("fail")
                      }
                      else if(val==1){
                          print("succes")
                      }
                  }
          }
  </code></pre>
  
  <p>And I use 2 PHP Files:
  connect.php</p>
  
  <pre><code>    define('HOST','localhost');
      define('USER','root');
      define('PASS','');
      define('DB','GLOBAL');
  
      $con = mysqli_connect(HOST,USER,PASS,DB) or die('unable to connect to db');
  </code></pre>
  
  <p>and 
  login.php</p>
  
  <pre><code>   if($_SERVER['REQUEST_METHOD']=='GET') {
  
     $response = array();
     $user_name = $_GET['user_name'];
     $user_password = $_GET['user_password'];
  
     require_once('connect.php');
  
      $sql1 = "SELECT * FROM user WHERE user_name ='$user_name'";
      $checkemail = mysqli_fetch_array(mysqli_query($con,$sql1));
  
      $sql2 = "SELECT * FROM user WHERE user_password ='$user_password'";
      $checkpassword = mysqli_fetch_array(mysqli_query($con,$sql2));
  
     if(isset($checkemail)){
       $response["value"] = 0;
       $response["message"] = "correct email";
       echo json_encode($response);
     }else {
         $response["value"] = 0;
         $response["message"] = "oops! this email is not registered";
         echo json_encode($response);
       }
  
      if(isset($checkpassword)){
          $response["value"] = 0;
          $response["message"] = "correct passs";
          echo json_encode($response);
      }else {
          $response["value"] = 0;
          $response["message"] = "oops! wrong password";
          echo json_encode($response);
      }
  
     mysqli_close($con);
  } else {
    $response["value"] = 0;
    $response["message"] = "conexion failed2!";
    echo json_encode($response);
  }
  </code></pre>
  
  <p>This is the error that I have:</p>
  
  <pre><code>from login
  STATUS Optional(200)
  ERROR Optional(Alamofire.AFError.responseSerializationFailed(reason: Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(error: Error Domain=NSCocoaErrorDomain Code=3840 "Garbage at end." UserInfo={NSDebugDescription=Garbage at end.})))
  RESULT nil
  </code></pre>
  
  <p>And if I change the alamofire.request with a method: .post I have this:</p>
  
  <pre><code>from login
  STATUS Optional(200)
  ERROR nil
  RESULT Optional({
      message = "conexion failed2!";
      value = 0;
  })
  </code></pre>
  
  <p>When I access to <a href="http://localhost/API/login.php" rel="nofollow noreferrer">http://localhost/API/login.php</a></p>
  
  <pre><code>Notice: Undefined index: user_name in /Applications/XAMPP/xamppfiles/htdocs/API/login.php on line 7
  
  Notice: Undefined index: user_password in /Applications/XAMPP/xamppfiles/htdocs/API/login.php on line 8
  {"value":0,"message":"oops! this email is not registered"}{"value":0,"message":"oops! wrong password"}
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>        let headers = ["Content-Type": "application/x-www-form-urlencoded"]
          let completeURL = "http://the_complete_url_here"
          let parameters: [String: String] =
              ["user_name":"john",
               "user_password":"secret"]
          Alamofire.request(url, method: .post, parameters: (parameters as! Parameters), encoding: URLEncoding.default, headers: headers).responseJSON { response in
  
              if let JSON = response.result.value {
                  print("JSON: \(JSON)") // your JSONResponse result
  //                completionHandler(JSON as! NSDictionary)
              }
              else {
                  print(response.result.error!)
              }
          }
  </code></pre>
  
  <p>I have:</p>
  
  <pre><code>JSON: {
      message = "conexion failed2!";
      value = 0;
  }
  </code></pre>
  
  <p>So I think the issue is in my login.php.</p>